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

Unified Diff: src/isolate.cc

Issue 1157273002: Reland "Fixed a couple of failing DCHECK(has_pending_exception())." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes Created 5 years, 7 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 | « src/debug.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 0b2478691bbf347aca4eb847998986ab854cedd4..38c8ed8fed921f3ee8bfdcc8f70e9e5c52e871a5 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -849,9 +849,13 @@ Object* Isolate::StackOverflow() {
// constructor. Instead, we copy the pre-constructed boilerplate and
// attach the stack trace as a hidden property.
Handle<String> key = factory()->stack_overflow_string();
- Handle<JSObject> boilerplate = Handle<JSObject>::cast(
- Object::GetProperty(js_builtins_object(), key).ToHandleChecked());
- Handle<JSObject> exception = factory()->CopyJSObject(boilerplate);
+ Handle<Object> boilerplate =
+ Object::GetProperty(js_builtins_object(), key).ToHandleChecked();
+ if (boilerplate->IsUndefined()) {
+ return Throw(heap()->undefined_value(), nullptr);
Igor Sheludko 2015/05/27 14:33:57 Maybe it is better to throw "stack overflow" inste
Yang 2015/05/29 11:04:52 When does this actually happen?
Igor Sheludko 2015/05/29 11:14:42 The test case attached calls %DebugGetLoadedScript
+ }
+ Handle<JSObject> exception =
+ factory()->CopyJSObject(Handle<JSObject>::cast(boilerplate));
Throw(*exception, nullptr);
CaptureAndSetSimpleStackTrace(exception, factory()->undefined_value());
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698