Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embind test to expose unique_ptr bug #21625

Closed
wants to merge 1 commit into from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Mar 27, 2024

No description provided.

@sbc100 sbc100 requested a review from brendandahl March 27, 2024 00:40
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Mar 27, 2024
As pointed out by emscripten-core#21625, when using unique_ptr's with primitive types the
raw pointer was being passed between wasm and JS, but it was using the
underlying type (e.g. char, int, etc) to convert the value. This means the
pointer was truncated to a char at the boundary.

Embind doesn't allow pointers or references to primitive types so it doesn't
make sense to allow a unique_ptr for these types either.
brendandahl added a commit to brendandahl/emscripten that referenced this pull request Mar 27, 2024
As pointed out by emscripten-core#21625, when using unique_ptr's with primitive types the
raw pointer was being passed between wasm and JS, but it was using the
underlying type (e.g. char, int, etc) to convert the value. This means the
pointer was truncated to a char at the boundary.

Embind doesn't allow pointers or references to primitive types so it doesn't
make sense to allow a unique_ptr for these types either.
@sbc100 sbc100 closed this Mar 28, 2024
@sbc100 sbc100 deleted the embind_unique_ptr_test branch March 28, 2024 21:05
brendandahl added a commit that referenced this pull request Apr 8, 2024
As pointed out by #21625, when using unique_ptr's with primitive types the
raw pointer was being passed between wasm and JS, but it was using the
underlying type (e.g. char, int, etc) to convert the value. This means the
pointer was truncated to a char at the boundary.

Embind doesn't allow pointers or references to primitive types so it doesn't
make sense to allow a unique_ptr for these types either.
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Apr 11, 2024
…core#21637)

As pointed out by emscripten-core#21625, when using unique_ptr's with primitive types the
raw pointer was being passed between wasm and JS, but it was using the
underlying type (e.g. char, int, etc) to convert the value. This means the
pointer was truncated to a char at the boundary.

Embind doesn't allow pointers or references to primitive types so it doesn't
make sense to allow a unique_ptr for these types either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant