diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 4aeb2ac550b..34e8b22aabf 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -428,10 +428,13 @@ js::RunScript(JSContext *cx, JSScript *script, StackFrame *fp) JS_ASSERT(script); JS_ASSERT(fp == cx->fp()); JS_ASSERT(fp->script() == script); + JS_ASSERT_IF(!fp->isGeneratorFrame(), cx->regs().pc == script->code); #ifdef JS_METHODJIT_SPEW JMCheckLogging(); #endif + JS_CHECK_RECURSION(cx, return false); + /* FIXME: Once bug 470510 is fixed, make this an assert. */ if (script->compileAndGo) { if (fp->scopeChain().global().isCleared()) { @@ -1567,9 +1570,6 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode) int32_t len; len = 0; - /* Check for too deep of a native thread stack. */ - JS_CHECK_RECURSION(cx, goto error); - DO_NEXT_OP(len); #if JS_THREADED_INTERP @@ -4028,6 +4028,9 @@ END_CASE(JSOP_ARRAYPUSH) JS_ASSERT(&cx->regs() == ®s); JS_ASSERT(uint32_t(regs.pc - script->code) < script->length); + /* When rejoining, we must not err before finishing Interpret's prologue. */ + JS_ASSERT(interpMode != JSINTERP_REJOIN); + if (cx->isExceptionPending()) { /* Restore atoms local in case we will resume. */ atoms = script->atoms; diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp index e92929fb32e..e36d7add87b 100644 --- a/js/src/methodjit/InvokeHelpers.cpp +++ b/js/src/methodjit/InvokeHelpers.cpp @@ -367,7 +367,9 @@ UncachedInlineCall(VMFrame &f, InitialFrameFlags initial, regs.fp()->resetInlinePrev(f.fp(), f.regs.pc); } - bool ok = !!Interpret(cx, cx->fp()); + JS_CHECK_RECURSION(cx, return false); + + bool ok = Interpret(cx, cx->fp()); f.cx->stack.popInlineFrame(regs); if (ok)