diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-14 21:28:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 21:28:43 -0700 |
commit | e567fa8675831e79f855cea2181fa58beb107e42 (patch) | |
tree | 14f1e37d27244b349e8ee34939119002f742748d /src/wasm-validator.h | |
parent | 63b499e3ec9bbdf4e79ab6d9dc198299516e8aec (diff) | |
parent | af3bea2786fe62070522b7fd7add4290a4cb4e6d (diff) | |
download | binaryen-e567fa8675831e79f855cea2181fa58beb107e42.tar.gz binaryen-e567fa8675831e79f855cea2181fa58beb107e42.tar.bz2 binaryen-e567fa8675831e79f855cea2181fa58beb107e42.zip |
Merge pull request #695 from WebAssembly/opts
Get optimizer on par with emscripten asm.js optimizer
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r-- | src/wasm-validator.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index 58a30f9a3..e23221337 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -104,6 +104,9 @@ public: void visitIf(If *curr) { shouldBeTrue(curr->condition->type == unreachable || curr->condition->type == i32 || curr->condition->type == i64, curr, "if condition must be valid"); + if (!curr->ifFalse) { + shouldBeFalse(isConcreteWasmType(curr->ifTrue->type), curr, "if without else must not return a value in body"); + } } // override scan to add a pre and a post check task to all nodes |