Better fix for recursion and let blocks (bug 547791, r=gal).

This commit is contained in:
David Anderson 2010-02-23 16:14:34 -08:00
parent 06cc81805b
commit c99331c609
3 changed files with 5 additions and 1 deletions

View File

@ -403,6 +403,8 @@ js_PopInterpFrame(JSContext* cx, InterpState* state)
return JS_FALSE;
if (cx->fp->imacpc)
return JS_FALSE;
if (cx->fp->blockChain)
return JS_FALSE;
cx->fp->putActivationObjects(cx);

View File

@ -226,7 +226,7 @@ TraceRecorder::upRecursion()
unsigned totalSlots = NativeStackSlots(cx, 1);
unsigned downPostSlots = totalSlots - NativeStackSlots(cx, 0);
FrameInfo* fi = (FrameInfo*)alloca(sizeof(FrameInfo) + totalSlots * sizeof(TraceType));
fi->block = cx->fp->down->blockChain;
fi->block = NULL;
fi->pc = (jsbytecode*)return_pc;
fi->imacpc = NULL;

View File

@ -9723,6 +9723,8 @@ IsTraceableRecursion(JSContext *cx)
return false;
if ((fp->flags & JSFRAME_CONSTRUCTING) || (down->flags & JSFRAME_CONSTRUCTING))
return false;
if (fp->blockChain || down->blockChain)
return false;
if (*fp->script->code != JSOP_TRACE)
return false;
return true;