From a5e32dfc7c3cd2899739298d80a2e707cc025bb2 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sat, 27 May 2017 12:48:34 -0700 Subject: fix call depth detection in wasm-opt interpreting --- src/wasm-interpreter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wasm-interpreter.h') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index b06afb1a1..a8eda4e8f 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -692,6 +692,7 @@ private: // stack traces. std::vector functionStack; +public: // Call a function, starting an invocation. Literal callFunction(Name name, LiteralList& arguments) { // if the last call ended in a jump up the stack, it might have left stuff for us to clean up here @@ -700,7 +701,6 @@ private: return callFunctionInternal(name, arguments); } -public: // Internal function call. Must be public so that callTable implementations can use it (refactor?) Literal callFunctionInternal(Name name, LiteralList& arguments) { -- cgit v1.2.3 From f47d054dcc34dd709f36716c9fab07087db829e1 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sun, 28 May 2017 13:14:33 -0700 Subject: remove unneeded code in interpreter --- src/wasm-interpreter.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/wasm-interpreter.h') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index a8eda4e8f..0b01fb1d3 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -903,7 +903,6 @@ public: Flow flow = RuntimeExpressionRunner(*this, scope).visit(function->body); assert(!flow.breaking() || flow.breakTo == RETURN_FLOW); // cannot still be breaking, it means we missed our stop Literal ret = flow.value; - if (function->result == none) ret = Literal(); if (function->result != ret.type) { std::cerr << "calling " << function->name << " resulted in " << ret << " but the function type is " << function->result << '\n'; WASM_UNREACHABLE(); -- cgit v1.2.3