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

Unified Diff: src/debug.cc

Issue 1182703003: [V8] Fixed infinite loop in Debug::PrepareStep (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 342aa505da7b6378f66f9636dfc3eef12ce3df1d..e96ef4626d7d402e927dd7f96634c8eaeaad4e3b 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -1360,11 +1360,16 @@ void Debug::PrepareStep(StepAction step_action,
Isolate* isolate = JSFunction::cast(fun)->GetIsolate();
Code* apply = isolate->builtins()->builtin(Builtins::kFunctionApply);
Code* call = isolate->builtins()->builtin(Builtins::kFunctionCall);
+ // Find target function on the expression stack for expression like
+ // Function.call.call...apply(...)
+ int i = 1;
while (fun->IsJSFunction()) {
Code* code = JSFunction::cast(fun)->shared()->code();
if (code != apply && code != call) break;
- fun = frame->GetExpression(
- expressions_count - 1 - call_function_arg_count);
+ DCHECK(expressions_count - i - call_function_arg_count >= 0);
+ fun = frame->GetExpression(expressions_count - i -
+ call_function_arg_count);
+ i -= 1;
}
}
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698