[INFER] Add mising MakeTypeId when fixing properties in object literal types to double, bug 673713.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 25 Jul 2011 07:28:07 -0700
changeset 76064 bf459add722bb0799b73c69b18b7b7f17f4fb778
parent 76063 3ccf931079419c397420407d4eda196e99123222
child 76065 5ba8d207d7f3e4b5906183b0cd494e944e86d837
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs673713
milestone8.0a1
[INFER] Add mising MakeTypeId when fixing properties in object literal types to double, bug 673713.
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -2474,18 +2474,20 @@ TypeCompartment::fixObjectType(JSContext
             if (ntype != types[i]) {
                 if (NumberTypes(ntype, types[i])) {
                     if (types[i].isPrimitive(JSVAL_TYPE_INT32)) {
                         types[i] = Type::DoubleType();
                         const Shape *shape = baseShape;
                         while (!JSID_IS_EMPTY(shape->propid)) {
                             if (shape->slot == i) {
                                 Type type = Type::DoubleType();
-                                if (!p->value.object->unknownProperties())
-                                    p->value.object->addPropertyType(cx, shape->propid, type);
+                                if (!p->value.object->unknownProperties()) {
+                                    jsid id = MakeTypeId(cx, shape->propid);
+                                    p->value.object->addPropertyType(cx, id, type);
+                                }
                                 break;
                             }
                             shape = shape->previous();
                         }
                     }
                 } else {
                     return;
                 }
@@ -2532,18 +2534,20 @@ TypeCompartment::fixObjectType(JSContext
             cx->compartment->types.setPendingNukeTypes(cx);
             return;
         }
 
         const Shape *shape = baseShape;
         while (!JSID_IS_EMPTY(shape->propid)) {
             ids[shape->slot] = shape->propid;
             types[shape->slot] = GetValueType(cx, obj->getSlot(shape->slot));
-            if (!objType->unknownProperties())
-                objType->addPropertyType(cx, MakeTypeId(cx, shape->propid), types[shape->slot]);
+            if (!objType->unknownProperties()) {
+                jsid id = MakeTypeId(cx, shape->propid);
+                objType->addPropertyType(cx, id, types[shape->slot]);
+            }
             shape = shape->previous();
         }
 
         /* Construct the new shape. */
         for (unsigned i = 0; i < obj->slotSpan(); i++) {
             if (!DefineNativeProperty(cx, xobj, ids[i], UndefinedValue(), NULL, NULL,
                                       JSPROP_ENUMERATE, 0, 0, DNP_SKIP_TYPE)) {
                 cx->compartment->types.setPendingNukeTypes(cx);