Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: src/wasm/wasm-interpreter.cc

Issue 2650293003: [wasm] Interpreter: Don't pause on invalid position (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()))
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698