diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-27 13:39:53 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-27 13:48:32 -0800 |
commit | f0dd7c4c98566751a63807572b9ca66b294ef434 (patch) | |
tree | 8adae46a75e42c29562defeac625daff52a7647f /src | |
parent | de4fcd7a0118072991ad1ab0bb11d798ef895458 (diff) | |
download | binaryen-f0dd7c4c98566751a63807572b9ca66b294ef434.tar.gz binaryen-f0dd7c4c98566751a63807572b9ca66b294ef434.tar.bz2 binaryen-f0dd7c4c98566751a63807572b9ca66b294ef434.zip |
fix select type
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 2 | ||||
-rw-r--r-- | src/wasm.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index be0d11e0a..08be2019a 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1570,7 +1570,7 @@ public: readExpression(curr->ifTrue); readExpression(curr->ifFalse); readExpression(curr->condition); - curr->type = curr->ifTrue->type; + curr->finalize(); } bool maybeVisitImpl(Host *curr, uint8_t code) { switch (code) { diff --git a/src/wasm.h b/src/wasm.h index 94c3cbdaa..5b56cd62d 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -851,6 +851,11 @@ public: printFullLine(o, indent, ifFalse); return decIndent(o, indent); } + + void finalize() { + type = ifTrue->type; + if (type == none) type = ifFalse->type; // ifTrue might be unreachable + } }; class Host : public Expression { |