From 9dcdd47a255914bae36f146f0561ac3ac89aa14b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 7 Mar 2023 14:26:14 -0800 Subject: 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. --- src/passes/CodePushing.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') 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> { 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 create() override { return std::make_unique(); } -- cgit v1.2.3