[INFER] Fix GC hazard, bug 679094.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 15 Aug 2011 18:52:22 -0700
changeset 76126 74bfd74ca2895c602d8c3f6269b9ef8106b69723
parent 76125 0d5f119ab1722c0002c367cbf6061585eb54d65b
child 76127 427522c34b31ba8039e5a2304739986f4f9d42c8
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs679094
milestone8.0a1
[INFER] Fix GC hazard, bug 679094.
js/src/jsparse.cpp
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -1108,17 +1108,17 @@ Compiler::compileScript(JSContext *cx, J
 
     script = JSScript::NewScriptFromCG(cx, &cg);
     if (!script)
         goto out;
 
     JS_ASSERT(script->savedCallerFun == savedCallerFun);
 
     {
-        AutoShapeRooter shapeRoot(cx, script->bindings.lastShape());
+        AutoScriptRooter root(cx, script);
         if (!defineGlobals(cx, globalScope, script))
             goto late_error;
     }
 
   out:
     JS_FinishArenaPool(&codePool);
     JS_FinishArenaPool(&notePool);
     Probes::compileScriptEnd(cx, script, filename, lineno);