summaryrefslogtreecommitdiff
path: root/src/passes/Vacuum.cpp
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-07-10 15:43:21 -0700
committerAlon Zakai (kripken) <alonzakai@gmail.com>2017-07-11 11:07:45 -0700
commit5c4c6ba03e1c42cee86e580c09b8c66a6bb1a71c (patch)
tree1e4a19d462d105d006f2413e10f2b7cd91d42d42 /src/passes/Vacuum.cpp
parent987003944456c3d04f74c12067ac950feca1a81e (diff)
downloadbinaryen-5c4c6ba03e1c42cee86e580c09b8c66a6bb1a71c.tar.gz
binaryen-5c4c6ba03e1c42cee86e580c09b8c66a6bb1a71c.tar.bz2
binaryen-5c4c6ba03e1c42cee86e580c09b8c66a6bb1a71c.zip
properly handle if arm removal in vacuum
Diffstat (limited to 'src/passes/Vacuum.cpp')
-rw-r--r--src/passes/Vacuum.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp
index 4adfc1289..b58bea4b3 100644
--- a/src/passes/Vacuum.cpp
+++ b/src/passes/Vacuum.cpp
@@ -204,9 +204,13 @@ struct Vacuum : public WalkerPass<PostWalker<Vacuum>> {
Expression* child;
if (value->value.getInteger()) {
child = curr->ifTrue;
+ if (curr->ifFalse) {
+ typeUpdater.noteRecursiveRemoval(curr->ifFalse);
+ }
} else {
if (curr->ifFalse) {
child = curr->ifFalse;
+ typeUpdater.noteRecursiveRemoval(curr->ifTrue);
} else {
ExpressionManipulator::nop(curr);
return;