Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upcranelift-wasm: Fix reachability tracking for `if .. else .. end` #1143
Conversation
We weren't previously keeping track of quite the right information for whether an `if .. else .. end`'s following block was reachable or not. It should be reachable if the head is reachable and either the consequent or alternative end reachable (and therefore fall through to the following block) or do an early `br_if` to it. This commit rejiggers `ControlStackFrame::If` to keep track of reachability at the end of the consequent (we don't need to keep track of it at the end of the alternative, since that is simply `state.reachable`) and adds Wasm tests for every reachability situation we can encounter with `if .. else .. end`. Fixes #1132
This comment was marked as resolved.
This comment was marked as resolved.
CI failure looks like it is just a flaky CI thing, but I also don't have the ability to retry the job. |
This comment was marked as resolved.
This comment was marked as resolved.
I bumped it... let's see what happens. |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks! |
This comment was marked as resolved.
This comment was marked as resolved.
Hmm still failing with the same linker error:
I can't imagine what in this PR would mess with the asan/CI setup... |
This comment has been minimized.
This comment has been minimized.
Thanks, I confirm this fixes all the pending wasm tests to add, as well as all the Spidermonkey tests that were passing before. I can review it, but @sunfishcode probably has a better preexisting understanding of this code, since he's reviewed the first batch of changes. |
a1f2a15
into
bytecodealliance:master
13 checks passed
13 checks passed
This comment has been minimized.
This comment has been minimized.
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fitzgen commentedOct 14, 2019
We weren't previously keeping track of quite the right information for whether an
if .. else .. end
's following block was reachable or not. It should be reachable if the head is reachable and either the consequent or alternative end reachable (and therefore fall through to the following block) or do an earlybr_if
to it.This commit rejiggers
ControlStackFrame::If
to keep track of reachability at the end of the consequent (we don't need to keep track of it at the end of the alternative, since that is simplystate.reachable
) and adds Wasm tests for every reachability situation we can encounter withif .. else .. end
.Fixes #1132