diff options
-rw-r--r-- | src/passes/Vacuum.cpp | 1 | ||||
-rw-r--r-- | test/passes/vacuum.txt | 4 | ||||
-rw-r--r-- | test/passes/vacuum.wast | 23 |
3 files changed, 28 insertions, 0 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 3f27fb36a..bb6c7c296 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -225,6 +225,7 @@ struct Vacuum : public WalkerPass<PostWalker<Vacuum>> { child = curr->ifFalse; typeUpdater.noteRecursiveRemoval(curr->ifTrue); } else { + typeUpdater.noteRecursiveRemoval(curr); ExpressionManipulator::nop(curr); return; } diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt index f3b06af1a..011fb99f5 100644 --- a/test/passes/vacuum.txt +++ b/test/passes/vacuum.txt @@ -301,4 +301,8 @@ ) ) ) + (func $nop-if-type-changes (type $0) + (local $0 i32) + (nop) + ) ) diff --git a/test/passes/vacuum.wast b/test/passes/vacuum.wast index db4bf6749..3b5b22e9c 100644 --- a/test/passes/vacuum.wast +++ b/test/passes/vacuum.wast @@ -637,4 +637,27 @@ (i32.const 1579493952) ) ) + (func $nop-if-type-changes (type $0) + (local $0 i32) + (block $label$0 + (if + (i32.eqz + (get_local $0) + ) + (block $label$1 + (block + (if ;; we nop this if, which has a type change for block $label$1, no more brs to it + (i32.const 0) + (br_if $label$1 + (i32.const 1717966400) + ) + ) + (drop + (br $label$0) + ) + ) + ) + ) + ) + ) ) |