diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-06-06 15:53:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-06-06 15:53:09 -0700 |
commit | 74906514eed3196212b370f09946ba76d1fccee3 (patch) | |
tree | 627cd1bdc92acf0ab51233c1fca60400cbd75e1a /src | |
parent | 208d1806972d20f22f76ab3a880310d3104d1603 (diff) | |
download | binaryen-74906514eed3196212b370f09946ba76d1fccee3.tar.gz binaryen-74906514eed3196212b370f09946ba76d1fccee3.tar.bz2 binaryen-74906514eed3196212b370f09946ba76d1fccee3.zip |
fix if type; if one is none and the other is concrete, still none (#575)
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h index 3b318c6ee..a71e09d19 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -974,7 +974,15 @@ public: void finalize() { assert(ifTrue); if (ifFalse) { - type = getReachableWasmType(ifTrue->type, ifFalse->type); + if (ifTrue->type == ifFalse->type) { + type = ifTrue->type; + } else if (isConcreteWasmType(ifTrue->type) && ifFalse->type == unreachable) { + type = ifTrue->type; + } else if (isConcreteWasmType(ifFalse->type) && ifTrue->type == unreachable) { + type = ifFalse->type; + } else { + type = none; + } } } }; |