Fix GC hazard, bug 679094. r=jorendorff.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 16 Aug 2011 06:52:44 -0500
changeset 75365 7027d3788076fb207f974f92554c033666bcb17e
parent 75364 f8a0d02f12572dfbcdc578990deed6a98d1e8897
child 75366 2e4ddf7504157d05a356867e6418c8c0ea982276
push id21008
push userjorendorff@mozilla.com
push dateTue, 16 Aug 2011 11:54:41 +0000
treeherdermozilla-central@7027d3788076 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs679094
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix GC hazard, bug 679094. r=jorendorff.
js/src/jsparse.cpp
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -1119,17 +1119,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);