From ebb4cc7d0c655975cfc7b5538ed61bd09fd9a507 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 18 Nov 2015 21:11:45 -0800 Subject: add assert on breaking --- src/wasm-interpreter.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 2458b60e1..3f69d36e5 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -774,7 +774,9 @@ private: std::cout << "entering " << function->name << '\n'; #endif - Literal ret = ExpressionRunner(*this, scope).visit(function->body).value; + Flow flow = ExpressionRunner(*this, scope).visit(function->body); + assert(!flow.breaking()); // cannot still be breaking, it means we missed our stop + Literal ret = flow.value; if (function->result == none) ret = Literal(); assert(function->result == ret.type); callDepth--; -- cgit v1.2.3