summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-10-02 13:03:53 -0700
committerGitHub <noreply@github.com>2017-10-02 13:03:53 -0700
commit28d670ade33ab7a1d091bafee243a2c5ffc93bc9 (patch)
tree87c8860fb6dd2424f0bcac5bcdeb89a0e7b5cee1 /src
parent45d88e3ef5f895b2fde77e3588f84d66e67bdd88 (diff)
downloadbinaryen-28d670ade33ab7a1d091bafee243a2c5ffc93bc9.tar.gz
binaryen-28d670ade33ab7a1d091bafee243a2c5ffc93bc9.tar.bz2
binaryen-28d670ade33ab7a1d091bafee243a2c5ffc93bc9.zip
fix regression from 45d88e3ef5f895b2fde77e3588f84d66e67bdd88 - left may not exist, need to return curr->left, after that change (#1207)
Diffstat (limited to 'src')
-rw-r--r--src/passes/OptimizeInstructions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index cdfa29138..b59b41b6a 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -865,7 +865,7 @@ private:
// shifting a 0 is a 0, or anything by 0 has no effect, all unless the shift has side effects
if (((left && left->value.geti32() == 0) || (right && Bits::getEffectiveShifts(right) == 0)) &&
!EffectAnalyzer(passOptions, curr->right).hasSideEffects()) {
- replaceCurrent(left);
+ replaceCurrent(curr->left);
return;
}
} else if (curr->op == MulInt32) {