diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-10-12 11:32:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-12 11:32:56 -0700 |
commit | ada5fb540164823f8dab45330a190479afa24120 (patch) | |
tree | 68f6741458e21413c3b133041de5638c5d152eeb /src/passes/CoalesceLocals.cpp | |
parent | a08ccc3cdc2e53354f0eaeba419655b641b2b056 (diff) | |
download | binaryen-ada5fb540164823f8dab45330a190479afa24120.tar.gz binaryen-ada5fb540164823f8dab45330a190479afa24120.tar.bz2 binaryen-ada5fb540164823f8dab45330a190479afa24120.zip |
handle unreachable tee_local properly in coalesce-locals (#761)
Diffstat (limited to 'src/passes/CoalesceLocals.cpp')
-rw-r--r-- | src/passes/CoalesceLocals.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp index f2f26f96a..3127b429c 100644 --- a/src/passes/CoalesceLocals.cpp +++ b/src/passes/CoalesceLocals.cpp @@ -168,7 +168,11 @@ struct CoalesceLocals : public WalkerPass<CFGWalker<CoalesceLocals, Visitor<Coal auto* curr = (*currp)->cast<SetLocal>(); // if in unreachable code, ignore if (!self->currBasicBlock) { - ExpressionManipulator::nop(curr); + if (curr->isTee()) { + ExpressionManipulator::convert<SetLocal, Unreachable>(curr); + } else { + ExpressionManipulator::nop(curr); + } return; } self->currBasicBlock->contents.actions.emplace_back(Action::Set, curr->index, currp); |