From: yangguo@chromium.org Date: Tue, 4 Dec 2012 09:51:52 +0000 (+0000) Subject: Remove bogus test and add check for OOM in TryCall. X-Git-Tag: upstream/4.7.83~15509 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=192d21b5dd2a4679f48f9cfbcf76c313c5f1d947;p=platform%2Fupstream%2Fv8.git Remove bogus test and add check for OOM in TryCall. R=mstarzinger@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/11412318 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/execution.cc b/src/execution.cc index 8942fb3..67f67e8 100644 --- a/src/execution.cc +++ b/src/execution.cc @@ -211,6 +211,9 @@ Handle Execution::TryCall(Handle func, Isolate* isolate = Isolate::Current(); ASSERT(isolate->has_pending_exception()); ASSERT(isolate->external_caught_exception()); + if (isolate->is_out_of_memory() && !isolate->ignore_out_of_memory()) { + V8::FatalProcessOutOfMemory("OOM during Execution::TryCall"); + } if (isolate->pending_exception() == isolate->heap()->termination_exception()) { result = isolate->factory()->termination_exception(); diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc index 8d97cd8..941fa68 100644 --- a/test/cctest/test-debug.cc +++ b/test/cctest/test-debug.cc @@ -7532,18 +7532,4 @@ TEST(LiveEditDisabled) { } -TEST(DebugContextOOM) { - v8::HandleScope scope; - LocalContext context; - v8::V8::IgnoreOutOfMemoryException(); - - v8::Local 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