Bug 1254622 - Relookup group->newScript in CreateThisForFunctionWithGroup. r=bhackett a=lizzard
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 24 Mar 2016 15:09:41 +0100
changeset 319499 d8d0ebec994ceedbf808b3bc8a0bb001737bd888
parent 319498 30d8a8e73dc699ce133e47ee81741730e949f598
child 319500 1cb807f4882c65d281b0746ab5985758190bf054
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, lizzard
bugs1254622
milestone46.0
Bug 1254622 - Relookup group->newScript in CreateThisForFunctionWithGroup. r=bhackett a=lizzard MozReview-Commit-ID: KXd7kB70f1Z
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -926,18 +926,19 @@ CreateThisForFunctionWithGroup(JSContext
         // Not enough objects with this group have been created yet, so make a
         // plain object and register it with the group. Use the maximum number
         // of fixed slots, as is also required by the TypeNewScript.
         gc::AllocKind allocKind = GuessObjectGCKind(NativeObject::MAX_FIXED_SLOTS);
         PlainObject* res = NewObjectWithGroup<PlainObject>(cx, group, allocKind, newKind);
         if (!res)
             return nullptr;
 
-        if (newKind != SingletonObject)
-            newScript->registerNewObject(res);
+        // Make sure group->newScript is still there.
+        if (newKind != SingletonObject && group->newScript())
+            group->newScript()->registerNewObject(res);
 
         return res;
     }
 
     gc::AllocKind allocKind = NewObjectGCKind(&PlainObject::class_);
 
     if (newKind == SingletonObject) {
         Rooted<TaggedProto> protoRoot(cx, group->proto());