diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-02 16:35:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-02 16:35:41 -0700 |
commit | 9046e5fb540c92c7d994ba72893c724415ab371b (patch) | |
tree | a420621c7b95a5d7d1b7a297434a52f386839d54 /src | |
parent | 31ceb6ef95835952097ecc868eff9bdd7fb17d34 (diff) | |
download | binaryen-9046e5fb540c92c7d994ba72893c724415ab371b.tar.gz binaryen-9046e5fb540c92c7d994ba72893c724415ab371b.tar.bz2 binaryen-9046e5fb540c92c7d994ba72893c724415ab371b.zip |
fix vacuum big where we changed an unreachable node to a nop (#728)
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Vacuum.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index c3fed2328..8d9bb421c 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -177,7 +177,11 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum, Visitor<Vacuum>> if (isConcreteWasmType(curr->type) || EffectAnalyzer(list[0]).hasSideEffects()) { replaceCurrent(list[0]); } else { - ExpressionManipulator::nop(curr); + if (curr->type == unreachable) { + ExpressionManipulator::convert<Block, Unreachable>(curr); + } else { + ExpressionManipulator::nop(curr); + } } } else if (list.size() == 0) { ExpressionManipulator::nop(curr); |