From d366275dd638fa73f24e57987f12908994cade21 Mon Sep 17 00:00:00 2001 From: "danno@chromium.org" Date: Tue, 3 Apr 2012 15:54:07 +0000 Subject: [PATCH] Fix stack overflow test failures with no snap. R=mstarzinger@chromium.org BUG=chromium:119429 Review URL: https://chromiumcodereview.appspot.com/9963108 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/bootstrapper.cc | 6 ++++++ src/debug.cc | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index a48bb4d..298652e 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -1301,6 +1301,12 @@ bool Genesis::CompileNative(Vector name, Handle source) { #ifdef ENABLE_DEBUGGER_SUPPORT isolate->debugger()->set_compiling_natives(true); #endif + // During genesis, the boilerplate for stack overflow won't work until the + // environment has been at least partially initialized. Add a stack check + // before entering JS code to catch overflow early. + StackLimitCheck check(Isolate::Current()); + if (check.HasOverflowed()) return false; + bool result = CompileScriptCached(name, source, NULL, diff --git a/src/debug.cc b/src/debug.cc index 457531f..99256ba 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -820,6 +820,9 @@ bool Debug::Load() { v8::Handle(), NULL); + // Fail if no context could be created. + if (context.is_null()) return false; + // Use the debugger context. SaveContext save(isolate_); isolate_->set_context(*context); -- 2.7.4