Skip to content

[pull] swiftwasm-release/5.5 from release/5.5 #3811

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
Oct 30, 2021

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 29, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

…" and ">= 0" comparisons

The wrong optimization was: fold x < 0 into false, if x is known to be a result of an unsigned operation with overflow checks enabled.
It was done under the wrong assumption that the result of an overflow-checked unsigned operation fits into a signed integer and is positive.
This is wrong, because the result of an unsigned operation can be larger than Int.max and therefore, when used in a signed integer operation, be re-interpreted as a negative signed value.

Fixes a miscompile which resulted in a missing abort on arithmetic overflow.

rdar://73596890
…g-5.5

[5.5] ConstantFolding: remove a wrong peephole optimization for signed "< 0" and ">= 0" comparisons
@MaxDesiatov MaxDesiatov enabled auto-merge October 29, 2021 22:57
@MaxDesiatov MaxDesiatov merged commit 1991f3e into swiftwasm-release/5.5 Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants