Fix LLVM crash on return
with a float on the stack and a crash with gas metering.
#1009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofmake 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 withmake bench-llvm
.Review