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

Correct the implementation of shift and rotate. #2155

Merged
merged 3 commits into from
Mar 2, 2021

Conversation

nlewycky
Copy link
Contributor

@nlewycky nlewycky commented Mar 1, 2021

Fixes #2143.

The existing implementations worked on x86-64 when instructions were emitted, but relied on UB per the LLVM IR. Add a test which checks the behaviour when the inputs are constants, so that the LLVM IR constant folder can see and exploit the UB.
@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Mar 1, 2021
2155: Correct the implementation of shift and rotate. r=syrusakbary a=nlewycky

Fixes #2143.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
@bors
Copy link
Contributor

bors bot commented Mar 1, 2021

Canceled.

@nlewycky
Copy link
Contributor Author

nlewycky commented Mar 1, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 2, 2021

@bors bors bot merged commit 3bab215 into master Mar 2, 2021
@bors bors bot deleted the feature/fix-overflow-shift-rotate branch March 2, 2021 00:41
@Hywan Hywan added bug Something isn't working 📦 lib-compiler-llvm About wasmer-compiler-llvm labels Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-compiler-llvm About wasmer-compiler-llvm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LLVM-compiled Wasm code produces incorrect result
3 participants