Skip to content

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

Merged
kripken merged 2 commits intomasterfrom
em10173
Jan 10, 2020
Merged

wasm2js: Do not convert x >>> 0 | 0 to x >>> 0#2581
kripken merged 2 commits intomasterfrom
em10173

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