summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm-validator.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 893306897..a19071959 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -206,7 +206,13 @@ public:
void visitReturn(Return* curr) {
if (curr->value) {
- returnType = curr->value->type;
+ if (returnType == unreachable) {
+ returnType = curr->value->type;
+ } else if (curr->value->type != unreachable && returnType != curr->value->type) {
+ returnType = none; // poison
+ }
+ } else {
+ returnType = none;
}
}