Bug 1002737 - Fix PropDesc vector rooting in DebugObject_defineProperties. (r=jorendorff)
☠☠ backed out by b922ed24938f ☠ ☠
authorEric Faust <efaustbmo@gmail.com>
Tue, 03 Jun 2014 12:37:44 -0700
changeset 206743 ec411f0ce167f6b6ad38909b4d9bb4b0e0b00f3b
parent 206742 8a63bad8faedc052e7011c943dd89647ca858454
child 206744 5a7cc51340a91b56cdc2aa15632ae2ba7aed415d
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1002737
milestone32.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
Bug 1002737 - Fix PropDesc vector rooting in DebugObject_defineProperties. (r=jorendorff)
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -5356,54 +5356,40 @@ DebuggerObject_defineProperties(JSContex
         return false;
 
     AutoIdVector ids(cx);
     AutoPropDescVector descs(cx);
     if (!ReadPropertyDescriptors(cx, props, false, &ids, &descs))
         return false;
     size_t n = ids.length();
 
-    AutoPropDescVector unwrappedDescs(cx);
     for (size_t i = 0; i < n; i++) {
-        if (!unwrappedDescs.append(PropDesc()))
+        if (!dbg->unwrapPropDescInto(cx, obj, descs[i], descs[i]))
             return false;
-        if (!dbg->unwrapPropDescInto(cx, obj, descs[i], unwrappedDescs[i]))
-            return false;
-        if (!unwrappedDescs[i].checkGetter(cx) || !unwrappedDescs[i].checkSetter(cx))
+        if (!descs[i].checkGetter(cx) || !descs[i].checkSetter(cx))
             return false;
     }
 
     {
-        AutoIdVector rewrappedIds(cx);
-        AutoPropDescVector rewrappedDescs(cx);
-
         Maybe<AutoCompartment> ac;
         ac.construct(cx, obj);
         for (size_t i = 0; i < n; i++) {
-            if (!rewrappedIds.append(ids[i]) || !rewrappedDescs.append(unwrappedDescs[i]))
-                return false;
-            if (!cx->compartment()->wrapId(cx, rewrappedIds[i].address()))
-                return false;
-            if (!cx->compartment()->wrap(cx, rewrappedDescs[i]))
+            if (!cx->compartment()->wrapId(cx, ids[i].address()))
                 return false;
-            if (rewrappedDescs[i].descriptorValue().isUndefined() &&
-                !rewrappedDescs[i].makeObject(cx))
-            {
+            if (!cx->compartment()->wrap(cx, descs[i]))
                 return false;
-            }
+            if (descs[i].descriptorValue().isUndefined() && !descs[i].makeObject(cx))
+                return false;
         }
 
         ErrorCopier ec(ac, dbg->toJSObject());
         for (size_t i = 0; i < n; i++) {
             bool dummy;
-            if (!DefineProperty(cx, obj, rewrappedIds[i],
-                                rewrappedDescs[i], true, &dummy))
-            {
+            if (!DefineProperty(cx, obj, ids[i], descs[i], true, &dummy))
                 return false;
-            }
         }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 /*