diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 16:23:20 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 16:23:20 -0700 |
commit | 7d5180a5b3e369634dbc1442117068d332d71049 (patch) | |
tree | 400f0b6d6df2764b2db01e7505eda4d9c04bb086 /src | |
parent | 8ef9aafab1a2c47f9a09c8e64636da570870dc00 (diff) | |
download | binaryen-7d5180a5b3e369634dbc1442117068d332d71049.tar.gz binaryen-7d5180a5b3e369634dbc1442117068d332d71049.tar.bz2 binaryen-7d5180a5b3e369634dbc1442117068d332d71049.zip |
fix a simplify-locals bug where we didn't notice and if already had a result value
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index e032acc77..acc6860be 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -351,9 +351,8 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals, // optimize set_locals from both sides of an if into a return value void optimizeIfReturn(If* iff, Expression** currp, Sinkables& ifTrue) { assert(iff->ifFalse); - // if this if already has a result that is used, we can't do anything - assert(expressionStack.back() == iff); - if (ExpressionAnalyzer::isResultUsed(expressionStack, getFunction())) return; + // if this if already has a result, we can't do anything + if (isConcreteWasmType(iff->type)) return; // We now have the sinkables from both sides of the if. Sinkables& ifFalse = sinkables; Index sharedIndex = -1; |