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

Fix LLVM crash on return with a float on the stack and a crash with gas metering. #1009

Merged
merged 5 commits into from
Nov 23, 2019

Conversation

nlewycky
Copy link
Contributor

@nlewycky nlewycky commented Nov 23, 2019

Description

This PR fixes some matters of testing. The return+float bug is caught by the LLVM verifier, which was accidentally unconditionally disabled even when running "make test check". Add a new cargo feature named "test" which is enabled by all the test crates. When the "test" feature is passed to the llvm-backend, run the LLVM verifier.

Add a new crate llvm-backend-test which has one test so far, to ensure that this bug with the return+float does not crash LLVM. Include this new crate in runs of make llvm.

Fix LLVM crash on return when there is a float with pending NaN canonicalization on the stack.

Now that we run the verifier in testing, we discover another bug where internal_field() incorrectly labels a GEP with a TBAA label instead of the intended load. Fix this by labeling the correct instruction. No new test is introduced since this is already caught with make bench-llvm.

Review

  • Add a short description of the the change to the CHANGELOG.md file

@nlewycky nlewycky force-pushed the feature/fix-return-float-bug branch from dc818d0 to 91671d5 Compare November 23, 2019 01:17
@nlewycky nlewycky requested a review from bjfish November 23, 2019 01:17
@nlewycky
Copy link
Contributor Author

bors r+

bors bot added a commit that referenced this pull request Nov 23, 2019
1009: Fix LLVM crash on `return` with a float on the stack and a crash with gas metering. r=nlewycky a=nlewycky

# Description
This PR fixes some matters of testing. The return+float bug is caught by the LLVM verifier, which was accidentally unconditionally disabled even when running "make test check". Add a new cargo feature named "test" which is enabled by all the test crates. When the "test" feature is passed to the llvm-backend, run the LLVM verifier.

Add a new crate `llvm-backend-test` which has one test so far, to ensure that this bug with the return+float does not crash LLVM. Include this new crate in runs of `make llvm`.

Fix LLVM crash on `return` when there is a float with pending NaN canonicalization on the stack.

Now that we run the verifier in testing, we discover another bug where `internal_field()` incorrectly labels a GEP with a TBAA label instead of the intended load. Fix this by labeling the correct instruction. No new test is introduced since this is already caught with `make bench-llvm`.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 23, 2019

Build succeeded

@bors bors bot merged commit 91671d5 into master Nov 23, 2019
@bors bors bot deleted the feature/fix-return-float-bug branch November 23, 2019 02:56
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.

2 participants