summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-validator.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index afa7b5d9c..b4d604c2c 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -339,8 +339,10 @@ public:
if (curr->body->type != unreachable) {
shouldBeEqual(curr->result, curr->body->type, curr->body, "function body type must match, if function returns");
}
- if (returnType != unreachable) {
- shouldBeEqual(curr->result, returnType, curr->body, "function result must match, if function returns");
+ if (curr->result != none) { // TODO: over previous too?
+ if (returnType != unreachable) {
+ shouldBeEqual(curr->result, returnType, curr->body, "function result must match, if function returns");
+ }
}
returnType = unreachable;
}