diff options
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 |