summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck.py2
-rw-r--r--src/wasm-interpreter.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/check.py b/check.py
index fee50f5f8..732d7b196 100755
--- a/check.py
+++ b/check.py
@@ -83,7 +83,7 @@ if len(requested) == 0:
#spec_tests = [] # XXX [os.path.join('spec', t) for t in sorted(os.listdir(os.path.join('test', 'spec')))]
# 'address' : filed issue, test looks invalid
# 'exports' : has a "return" https://github.com/WebAssembly/spec/issues/164
- spec_tests = [os.path.join('spec', t + '.wast') for t in ['conversions', 'endianness', 'f32_cmp', 'f32', 'f64_cmp', 'f64', 'float_exprs', 'forward', 'func_ptrs']]
+ spec_tests = [os.path.join('spec', t + '.wast') for t in ['conversions', 'endianness', 'f32_cmp', 'f32', 'f64_cmp', 'f64', 'float_exprs', 'forward', 'func_ptrs', 'functions']]
else:
spec_tests = requested[:]
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.