diff options
author | Alon Zakai <azakai@google.com> | 2022-11-14 14:55:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 14:55:53 -0800 |
commit | a221b01b89ced3aa6335723e68bf17ea97377a08 (patch) | |
tree | f1fab7c0b49075ff557b3a8ecc123ae495f6c417 /src/passes/CodePushing.cpp | |
parent | 7df80050b6e5f3aa449da95b28a1d3e7eb778cb3 (diff) | |
download | binaryen-a221b01b89ced3aa6335723e68bf17ea97377a08.tar.gz binaryen-a221b01b89ced3aa6335723e68bf17ea97377a08.tar.bz2 binaryen-a221b01b89ced3aa6335723e68bf17ea97377a08.zip |
Fix a trivial CodePushing bug with looking at the wrong index (#5252)
Pretty simple logic bug, but it ended up causing us to not optimize sometimes.
Sadly the original tests happened to not have anything that depended on the
index in isolation.
Fix + add comprehensive tests for using that index properly. Also test the
call.without.effects intrinsic, which is orthoginal to this, but also worth testing
as it is a big use case here.
Diffstat (limited to 'src/passes/CodePushing.cpp')
-rw-r--r-- | src/passes/CodePushing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/CodePushing.cpp b/src/passes/CodePushing.cpp index 1ab037b12..20f16b145 100644 --- a/src/passes/CodePushing.cpp +++ b/src/passes/CodePushing.cpp @@ -293,7 +293,7 @@ private: // if we can push or not. EffectAnalyzer postIfEffects(passOptions, module); for (Index i = pushPoint + 1; i < list.size(); i++) { - postIfEffects.walk(list[pushPoint]); + postIfEffects.walk(list[i]); } // Start at the instruction right before the push point, and go back from |