summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index ae3f470ce..c4bf21d54 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -576,7 +576,11 @@ public:
Function *function = functions[name];
FunctionScope scope(function, arguments);
- return ExpressionRunner(*this, scope).visit(function->body).value;
+
+ Literal ret = ExpressionRunner(*this, scope).visit(function->body).value;
+ if (function->result == none) ret = Literal();
+ assert(function->result == ret.type);
+ return ret;
}
// Convenience method, for the case where you have no arguments.