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

Unified Diff: src/debug/debug.cc

Issue 2845853003: [debug] fix case of GC-unsafe access in Debug::HandleDebugBreak. (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 096f39765e1ae16e6c1691bae54990877eaca075..2ce32cccd82f419f7eb8468ff5450387523d2038 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -2143,9 +2143,9 @@ void Debug::HandleDebugBreak(IgnoreBreakMode ignore_break_mode) {
Object* fun = it.frame()->function();
if (fun && fun->IsJSFunction()) {
HandleScope scope(isolate_);
+ Handle<JSFunction> function(JSFunction::cast(fun), isolate_);
// Don't stop in builtin and blackboxed functions.
- Handle<SharedFunctionInfo> shared(JSFunction::cast(fun)->shared(),
- isolate_);
+ Handle<SharedFunctionInfo> shared(function->shared(), isolate_);
bool ignore_break = ignore_break_mode == kIgnoreIfTopFrameBlackboxed
? IsBlackboxed(shared)
: AllFramesOnStackAreBlackboxed();
@@ -2158,12 +2158,11 @@ void Debug::HandleDebugBreak(IgnoreBreakMode ignore_break_mode) {
// TODO(yangguo): introduce break_on_function_entry since current
// implementation is slow.
if (isolate_->stack_guard()->CheckDebugBreak()) {
- Deoptimizer::DeoptimizeFunction(JSFunction::cast(fun));
+ Deoptimizer::DeoptimizeFunction(*function);
}
return;
}
- JSGlobalObject* global =
- JSFunction::cast(fun)->context()->global_object();
+ JSGlobalObject* global = function->context()->global_object();
// Don't stop in debugger functions.
if (IsDebugGlobal(global)) return;
// Don't stop if the break location is muted.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698