Bug 901659 - Fix an exact rooting hazard in Debugger; r=jonco
authorTerrence Cole <terrence@mozilla.com>
Mon, 05 Aug 2013 12:51:35 -0700
changeset 141871 45f5051ec758735e4ee38229ed0b5cc69f49d331
parent 141870 3ec1dff8c4606c05b99adbcbc92822084e48d37a
child 141872 6231ff256efaf2cb52ab313ca18a2f2690a9643e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjonco
bugs901659
milestone26.0a1
Bug 901659 - Fix an exact rooting hazard in Debugger; r=jonco
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -4508,17 +4508,17 @@ DebuggerObject_getParameterNames(JSConte
 {
     THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "get parameterNames", args, obj);
     if (!obj->is<JSFunction>()) {
         args.rval().setUndefined();
         return true;
     }
 
     RootedFunction fun(cx, &obj->as<JSFunction>());
-    JSObject *result = NewDenseAllocatedArray(cx, fun->nargs);
+    RootedObject result(cx, NewDenseAllocatedArray(cx, fun->nargs));
     if (!result)
         return false;
     result->ensureDenseInitializedLength(cx, 0, fun->nargs);
 
     if (fun->isInterpreted()) {
         RootedScript script(cx);
 
         {