diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-05-01 15:11:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-01 15:11:08 -0700 |
commit | b6d42e0c28460667d9e9c992833be668d0897362 (patch) | |
tree | 4b40df398f07064b4b7a956d7fd4e24564dce143 /src | |
parent | 5bd7b2869f9ec664fd3e8746c1d469a04566a548 (diff) | |
download | binaryen-b6d42e0c28460667d9e9c992833be668d0897362.tar.gz binaryen-b6d42e0c28460667d9e9c992833be668d0897362.tar.bz2 binaryen-b6d42e0c28460667d9e9c992833be668d0897362.zip |
handle a drop of an if with both arms unreachable, which is possible since wasm added if types, which mean the if can be i32 even if the arms are unreachable etc (#991)
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Vacuum.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp index 63a098fc0..13b9c62fd 100644 --- a/src/passes/Vacuum.cpp +++ b/src/passes/Vacuum.cpp @@ -288,14 +288,12 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> { auto* iff = curr->value->dynCast<If>(); if (iff && iff->ifFalse && isConcreteWasmType(iff->type)) { // reuse the drop in both cases - if (iff->ifTrue->type == unreachable) { - assert(isConcreteWasmType(iff->ifFalse->type)); + if (iff->ifTrue->type == unreachable && isConcreteWasmType(iff->ifFalse->type)) { curr->value = iff->ifFalse; iff->ifFalse = curr; iff->type = none; replaceCurrent(iff); - } else if (iff->ifFalse->type == unreachable) { - assert(isConcreteWasmType(iff->ifTrue->type)); + } else if (iff->ifFalse->type == unreachable && isConcreteWasmType(iff->ifTrue->type)) { curr->value = iff->ifTrue; iff->ifTrue = curr; iff->type = none; |