From a2f3fbdc80b72fcf04a789e723de7f5561387dcc Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 May 2016 10:48:10 -0700 Subject: type check return types fully --- src/wasm-validator.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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; } } -- cgit v1.2.3