Commit 79643009 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix null dereference after OOM.

R=mstarzinger@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11414295

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13121 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 66f6a818
......@@ -786,9 +786,11 @@ bool Debug::CompileDebuggerScript(int index) {
"error_loading_debugger", &computed_location,
Vector<Handle<Object> >::empty(), Handle<String>(), Handle<JSArray>());
ASSERT(!isolate->has_pending_exception());
isolate->set_pending_exception(*exception);
MessageHandler::ReportMessage(Isolate::Current(), NULL, message);
isolate->clear_pending_exception();
if (!exception.is_null()) {
isolate->set_pending_exception(*exception);
MessageHandler::ReportMessage(Isolate::Current(), NULL, message);
isolate->clear_pending_exception();
}
return false;
}
......
......@@ -7532,4 +7532,18 @@ TEST(LiveEditDisabled) {
}
TEST(DebugContextOOM) {
v8::HandleScope scope;
LocalContext context;
v8::V8::IgnoreOutOfMemoryException();
v8::Local<v8::Value> result = CompileRun("a = '1'; while (true) a += a;");
// Check for out of memory state.
CHECK(result.IsEmpty());
CHECK(context->HasOutOfMemoryException());
v8::Debug::GetDebugContext();
}
#endif // ENABLE_DEBUGGER_SUPPORT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment