diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-23 20:34:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-23 20:34:56 -0700 |
commit | b6469ed600832887e8874d1a0407b993dd2c03e8 (patch) | |
tree | 325cafc1625265a8d7569a4f2b2a45910e4040fb /src/passes/SimplifyLocals.cpp | |
parent | dc82f588309f1a4413be18460159699df74661c4 (diff) | |
parent | 7d5180a5b3e369634dbc1442117068d332d71049 (diff) | |
download | binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.tar.gz binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.tar.bz2 binaryen-b6469ed600832887e8874d1a0407b993dd2c03e8.zip |
Merge pull request #710 from WebAssembly/autodrop-fix
Autodrop fixes
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-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; |