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

Unified Diff: src/debug.cc

Issue 553043002: Fix crash in ScriptDebugServer::wrapCallFrames (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed Created 6 years, 3 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') | test/cctest/test-debug.cc » ('J')
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 5bdf53f058e528ff7faf9760f36f45b54a7685a8..46917380d93be7bde33319dbf200e7db87220110 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2505,8 +2505,13 @@ MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) {
void Debug::OnThrow(Handle<Object> exception, bool uncaught) {
if (in_debug_scope() || ignore_events()) return;
+ // Temporarily clear any scheduled_exception to allow evaluating
+ // JavaScript from the debug event handler.
HandleScope scope(isolate_);
+ Object* scheduled_exception = isolate_->scheduled_exception();
Yang 2014/09/11 07:26:05 I just realized that this is not GC-safe. You have
aandrey 2014/09/11 08:20:24 But isolate_->thread_local_top()->scheduled_except
Yang 2014/09/11 08:26:21 Also, this getter asserts that we have a scheduled
aandrey 2014/09/11 08:47:22 Done.
+ isolate_->clear_scheduled_exception();
OnException(exception, uncaught, isolate_->GetPromiseOnStackOnThrow());
+ isolate_->thread_local_top()->scheduled_exception_ = scheduled_exception;
}
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698