Bug 1255223 - Null crash when logging weak maps. r=mccr8, a=ritu
authorPeter Van der Beken <peterv@propagandism.org>
Fri, 04 Mar 2016 23:11:37 +0100
changeset 323460 b335814379d83f7f8c128a186c2fc7aa064700ce
parent 323459 f95f7c876b15b2855e4cc1065c39410e74d7a3d3
child 323461 93f4293d8302d7e16314aeffd41d835b73ace5d4
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, ritu
bugs1255223
milestone47.0a2
Bug 1255223 - Null crash when logging weak maps. r=mccr8, a=ritu
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2465,18 +2465,19 @@ CCGraphBuilder::NoteWeakMapping(JSObject
   // do that in TraceWeakMapping in nsXPConnect.
   WeakMapping* mapping = mGraph.mWeakMaps.AppendElement();
   mapping->mMap = aMap ? AddWeakMapNode(aMap) : nullptr;
   mapping->mKey = aKey ? AddWeakMapNode(aKey) : nullptr;
   mapping->mKeyDelegate = aKdelegate ? AddWeakMapNode(aKdelegate) : mapping->mKey;
   mapping->mVal = aVal ? AddWeakMapNode(aVal) : nullptr;
 
   if (mLogger) {
-    mLogger->NoteWeakMapEntry((uint64_t)aMap, aKey.unsafeAsInteger(),
-                              (uint64_t)aKdelegate, aVal.unsafeAsInteger());
+    mLogger->NoteWeakMapEntry((uint64_t)aMap, aKey ? aKey.unsafeAsInteger() : 0,
+                              (uint64_t)aKdelegate,
+                              aVal ? aVal.unsafeAsInteger() : 0);
   }
 }
 
 static bool
 AddPurpleRoot(CCGraphBuilder& aBuilder, void* aRoot,
               nsCycleCollectionParticipant* aParti)
 {
   return aBuilder.AddPurpleRoot(aRoot, aParti);