Skip to content

Automatically convert returned pointers to unsigned in CAN_ADDRESS_GB mode. #19755

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jun 29, 2023

When we have a signature for native function and we know it returns a pointer we automatically interpret it as unsigned when it arrives in JS.

@sbc100 sbc100 changed the title Automatically convert return pointers to unsigned in CAN_ADDRESS_GB mode. Automatically convert returned pointers to unsigned in CAN_ADDRESS_GB mode. Jun 29, 2023
…ode.

When we have a signature for native function and we know it returns
a pointer we automatically interpret it as unsigned when it arrives in
JS.
@sbc100 sbc100 requested a review from kripken June 29, 2023 20:21
@sbc100 sbc100 force-pushed the convert_returned_pointers branch from 99d46d6 to e62bc66 Compare June 29, 2023 20:21
@sbc100
Copy link
Collaborator Author

sbc100 commented Jun 29, 2023

Even though there were only two places where I was actually able to remove the explicit >>>= 0 in the source code there are other places where this was missing (and could leave to bugs in CAN_ADDRESS_2GB. For example here:

var ptr = _emscripten_builtin_memalign({{{ WASM_PAGE_SIZE }}}, size);

@sbc100 sbc100 enabled auto-merge (squash) June 29, 2023 21:27
@sbc100 sbc100 merged commit 716f0b2 into main Jun 29, 2023
@sbc100 sbc100 deleted the convert_returned_pointers branch June 29, 2023 21:30
sbc100 added a commit that referenced this pull request Jun 30, 2023
Also, remove explicit coercion of result of _sbrk() call.  As of #19755
this happens automatically.
sbc100 added a commit that referenced this pull request Jun 30, 2023
Also, remove explicit coercion of result of _sbrk() call.  As of #19755
this happens automatically.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants