Bug 829294 - Some rooting for ClonedBlockScopeObject in DebugScopeProxy. r=terrence
authorTom Schuster <evilpies@gmail.com>
Fri, 11 Jan 2013 16:47:07 +0100
changeset 118596 7c92fc2dcd48c2526b41d0adb2183c3ce126b0f7
parent 118595 575c6e6283b68b4c8e17423e2295b03bd4a49eda
child 118597 1803280504e73cbf9e14f2fe3dd5e1914c71bf06
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersterrence
bugs829294
milestone21.0a1
Bug 829294 - Some rooting for ClonedBlockScopeObject in DebugScopeProxy. r=terrence
js/src/vm/ScopeObject.cpp
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -1221,39 +1221,39 @@ class DebugScopeProxy : public BaseProxy
                     TypeScript::SetArgument(cx, script, i, *vp);
             }
 
             return true;
         }
 
         /* Handle unaliased let and catch bindings at block scope. */
         if (scope->isClonedBlock()) {
-            ClonedBlockObject &block = scope->asClonedBlock();
-            UnrootedShape shape = block.lastProperty()->search(cx, id);
+            Rooted<ClonedBlockObject *> block(cx, &scope->asClonedBlock());
+            UnrootedShape shape = block->lastProperty()->search(cx, id);
             if (!shape)
                 return false;
 
             AutoAssertNoGC nogc;
             unsigned i = shape->shortid();
-            if (block.staticBlock().isAliased(i))
+            if (block->staticBlock().isAliased(i))
                 return false;
 
             if (maybefp) {
                 UnrootedScript script = maybefp->script();
-                unsigned local = block.slotToLocalIndex(script->bindings, shape->slot());
+                unsigned local = block->slotToLocalIndex(script->bindings, shape->slot());
                 if (action == GET)
                     *vp = maybefp->unaliasedLocal(local);
                 else
                     maybefp->unaliasedLocal(local) = *vp;
                 JS_ASSERT(analyze::LocalSlot(script, local) >= analyze::TotalSlots(script));
             } else {
                 if (action == GET)
-                    *vp = block.var(i, DONT_CHECK_ALIASING);
+                    *vp = block->var(i, DONT_CHECK_ALIASING);
                 else
-                    block.setVar(i, *vp, DONT_CHECK_ALIASING);
+                    block->setVar(i, *vp, DONT_CHECK_ALIASING);
             }
 
             return true;
         }
 
         /* The rest of the internal scopes do not have unaliased vars. */
         JS_ASSERT(scope->isDeclEnv() || scope->isWith() || scope->asCall().isForEval());
         return false;