Debugger: correctly ensure debug info in Debug::Break.
authoryangguo <yangguo@chromium.org>
Wed, 12 Aug 2015 07:30:24 +0000 (00:30 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 12 Aug 2015 07:30:40 +0000 (07:30 +0000)
R=bmeurer@chromium.org
BUG=chromium:517594
LOG=N

Review URL: https://codereview.chromium.org/1286143002

Cr-Commit-Position: refs/heads/master@{#30124}

src/debug/debug.cc

index 5583734..926c083 100644 (file)
@@ -580,8 +580,12 @@ void Debug::Break(Arguments args, JavaScriptFrame* frame) {
   PostponeInterruptsScope postpone(isolate_);
 
   // Get the debug info (create it if it does not exist).
-  Handle<SharedFunctionInfo> shared =
-      Handle<SharedFunctionInfo>(frame->function()->shared());
+  Handle<JSFunction> function(frame->function());
+  Handle<SharedFunctionInfo> shared(function->shared());
+  if (!EnsureDebugInfo(shared, function)) {
+    // Return if we failed to retrieve the debug info.
+    return;
+  }
   Handle<DebugInfo> debug_info(shared->GetDebugInfo());
 
   // Find the break point where execution has stopped.