Index: src/wasm/wasm-interpreter.cc |
diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc |
index 0c2886e7b1a21de066f2f187b26f576034dfa9df..39dda2a717df8ed293ccd1533c3ac75b20e587c6 100644 |
--- a/src/wasm/wasm-interpreter.cc |
+++ b/src/wasm/wasm-interpreter.cc |
@@ -1179,11 +1179,12 @@ class ThreadImpl { |
void Execute(InterpreterCode* code, pc_t pc, int max) { |
Decoder decoder(code->start, code->end); |
pc_t limit = code->end - code->start; |
- while (--max >= 0) { |
+ while (pc >= limit || --max >= 0) { |
titzer
2017/01/25 12:25:06
Hmm, that's weird. Why are we checking that the pc
Clemens Hammacher
2017/01/25 12:33:33
To run into the if 4 lines below. I can also make
|
#define PAUSE_IF_BREAK_FLAG(flag) \ |
if (V8_UNLIKELY(break_flags_ & WasmInterpreter::BreakFlag::flag)) max = 0; |
if (pc >= limit) { |
+ DCHECK_EQ(pc, limit); |
// Fell off end of code; do an implicit return. |
TRACE("@%-3zu: ImplicitReturn\n", pc); |
if (!DoReturn(&code, &pc, &limit, code->function->sig->return_count())) |