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 up
cranelift-wasm: Fix reachability tracking for `if .. else .. end` #1143
We weren't previously keeping track of quite the right information for whether an
This commit rejiggers
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
Hmm still failing with the same linker error:
I can't imagine what in this PR would mess with the asan/CI setup...
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.