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; |
} |
} |