diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index bee59b234aa..7a151b1fd49 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -1708,7 +1708,7 @@ NewObjectCache::invalidateEntriesForShape(JSContext *cx, HandleShape shape, Hand if (CanBeFinalizedInBackground(kind, clasp)) kind = GetBackgroundAllocKind(kind); - Rooted global(cx, &shape->getObjectParent()->global()); + Rooted global(cx, shape->compartment()->unsafeUnbarrieredMaybeGlobal()); RootedObjectGroup group(cx, ObjectGroup::defaultNewGroup(cx, clasp, TaggedProto(proto))); EntryIndex entry;