[INFER] Don't set script->isCachedEval until it is on the compartment's scriptsToGC, bug 642422.

This commit is contained in:
Brian Hackett 2011-03-17 12:22:57 -07:00
parent 9530ed9e7c
commit 138fd6109b
3 changed files with 5 additions and 3 deletions

View File

@ -0,0 +1,4 @@
gczeal(2);
var x;
var foo = "for (var z = 0; z < 2; ++z) { new Object(new String(this), x)}";
eval(foo);

View File

@ -1284,7 +1284,6 @@ EvalKernel(JSContext *cx, uintN argc, Value *vp, EvalType evalType, JSStackFrame
linearStr, staticLevel);
if (!script)
return false;
script->isCachedEval = true;
}
assertSameCompartment(cx, scopeobj, script);
@ -1300,6 +1299,7 @@ EvalKernel(JSContext *cx, uintN argc, Value *vp, EvalType evalType, JSStackFrame
MUST_FLOW_LABEL(destroy);
js_CallDestroyScriptHook(cx, script);
script->isCachedEval = true;
script->u.nextToGC = *bucket;
*bucket = script;
#ifdef CHECK_SCRIPT_OWNER

View File

@ -1125,8 +1125,6 @@ Compiler::compileScript(JSContext *cx, JSObject *scopeChain, JSStackFrame *calle
script = JSScript::NewScriptFromCG(cx, &cg);
if (script && funbox)
script->savedCallerFun = true;
if (script && cg.compilingForEval())
script->isCachedEval = true;
#ifdef JS_SCOPE_DEPTH_METER
if (script) {