Skip to content

wasm2js: Do not convert x >>> 0 | 0 to x >>> 0 #2581

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

Merged
merged 2 commits into from
Jan 10, 2020
Merged

wasm2js: Do not convert x >>> 0 | 0 to x >>> 0 #2581

merged 2 commits into from
Jan 10, 2020

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 9, 2020

isBinary was used where we should only accept
a signed binary, as removing the | 0 from an unsigned
value may be incorrect.

This does regress a few small things (as can be seen
in the diff). If it's important we can add more sophisticated
optimizations here, perhaps like an assumption that the
signedness of a local never matters.

Fixes emscripten-core/emscripten#10173

cc @juj

Copy link
Collaborator

@juj juj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@kripken kripken merged commit 263d2d5 into master Jan 10, 2020
@kripken kripken deleted the em10173 branch January 10, 2020 14:37
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.

Wasm2JS signed/unsigned miscompilation around right-shift when optimizations are enabled
2 participants