From c99331c609950f671936205eceae34c20a5583a5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 23 Feb 2010 16:14:34 -0800 Subject: [PATCH] Better fix for recursion and let blocks (bug 547791, r=gal). --- js/src/jsbuiltins.cpp | 2 ++ js/src/jsrecursion.cpp | 2 +- js/src/jstracer.cpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/jsbuiltins.cpp b/js/src/jsbuiltins.cpp index 666f215ca9c..e1a00ea7cbc 100644 --- a/js/src/jsbuiltins.cpp +++ b/js/src/jsbuiltins.cpp @@ -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); diff --git a/js/src/jsrecursion.cpp b/js/src/jsrecursion.cpp index b3a13c51674..e3f51fe28ce 100644 --- a/js/src/jsrecursion.cpp +++ b/js/src/jsrecursion.cpp @@ -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; diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index e3612a9c93e..096222b843e 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -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;