diff options
author | Alon Zakai <azakai@google.com> | 2023-03-07 14:26:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 14:26:14 -0800 |
commit | 9dcdd47a255914bae36f146f0561ac3ac89aa14b (patch) | |
tree | 25985de778e92fb271a70b8f64e548d5ff677a13 /src | |
parent | 789b1422fd5c7356d0af7fa1a16a84132c839021 (diff) | |
download | binaryen-9dcdd47a255914bae36f146f0561ac3ac89aa14b.tar.gz binaryen-9dcdd47a255914bae36f146f0561ac3ac89aa14b.tar.bz2 binaryen-9dcdd47a255914bae36f146f0561ac3ac89aa14b.zip |
CodePushing: Pushing into an if may require non-nullable fixups (#5551)
This became an issue because the timeline was this:
* We added non-nullable locals support. At the time, obviously
CodePushing did not require any fixups for that, since it just moved
code forward in a single block (and not past any uses). So we marked
the pass as not needing such fixups.
* We added pushing of code into ifs. But moving code into an if
can affect non-nullable validation since it is based on block scoping.
So we need to remove the mark on the pass, which will make it check and
apply fixups as necessary. See the testcase for an example.
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/CodePushing.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/passes/CodePushing.cpp b/src/passes/CodePushing.cpp index 2b45dda16..65eedba6b 100644 --- a/src/passes/CodePushing.cpp +++ b/src/passes/CodePushing.cpp @@ -455,11 +455,6 @@ private: struct CodePushing : public WalkerPass<PostWalker<CodePushing>> { bool isFunctionParallel() override { return true; } - // This pass moves code forward in blocks, but a local.set would not be moved - // after a local.get with the same index (effects prevent breaking things that - // way), so validation will be preserved. - bool requiresNonNullableLocalFixups() override { return false; } - std::unique_ptr<Pass> create() override { return std::make_unique<CodePushing>(); } |