Bug 940505 - Fix rooting hazard in JSObject2JSObjectMap::Add() r=bholley
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 20 Nov 2013 15:37:30 +0000
changeset 156638 a8220e44cf0326eab172cc3ed56b510b245c2ed5
parent 156637 c9d2dcea4480f4d72421db289fe69f54f3bb4010
child 156639 1f03cceef2f109ee9ce51e81fb6df35374f38000
push id25684
push usercbook@mozilla.com
push dateThu, 21 Nov 2013 13:21:05 +0000
treeherdermozilla-central@7427eede548f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs940505
milestone28.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 940505 - Fix rooting hazard in JSObject2JSObjectMap::Add() r=bholley
js/xpconnect/src/XPCMaps.h
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -641,17 +641,17 @@ public:
     /* Note: If the entry already exists, return the old value. */
     inline JSObject* Add(JSContext *cx, JSObject *key, JSObject *value) {
         NS_PRECONDITION(key,"bad param");
         Map::AddPtr p = mTable.lookupForAdd(key);
         if (p)
             return p->value;
         if (!mTable.add(p, key, value))
             return nullptr;
-        MOZ_ASSERT(xpc::GetObjectScope(key)->mWaiverWrapperMap == this);
+        MOZ_ASSERT(xpc::GetCompartmentPrivate(key)->scope->mWaiverWrapperMap == this);
         JS_StoreObjectPostBarrierCallback(cx, KeyMarkCallback, key, this);
         return value;
     }
 
     inline void Remove(JSObject* key) {
         NS_PRECONDITION(key,"bad param");
         mTable.remove(key);
     }