| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index cedb0efd00127bf54461832b2b706de4db675d0c..1c2d754239554292a6f17f27ab7a4f85842f472b 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -1317,6 +1317,12 @@ bool Genesis::CompileNative(Vector<const char> name, Handle<String> 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,
|
|
|