summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index e9ce5911d..4d198ac34 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -161,6 +161,16 @@ public:
if (curr->condition->type != unreachable) {
shouldBeEqual(curr->type, none, curr, "if without else and reachable condition must be none");
}
+ } else {
+ if (curr->type != unreachable) {
+ shouldBeEqualOrFirstIsUnreachable(curr->ifTrue->type, curr->type, curr, "returning if-else's true must have right type");
+ shouldBeEqualOrFirstIsUnreachable(curr->ifFalse->type, curr->type, curr, "returning if-else's false must have right type");
+ } else {
+ if (curr->condition->type != unreachable) {
+ shouldBeEqual(curr->ifTrue->type, unreachable, curr, "unreachable if-else must have unreachable true");
+ shouldBeEqual(curr->ifFalse->type, unreachable, curr, "unreachable if-else must have unreachable false");
+ }
+ }
}
}