Bug 1250134 - assert mJSRuntime when IsGrayJS() is true. r?mccr8 draft
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 23 Feb 2016 09:28:52 +0200
changeset 333269 d01a6e41afa005b3e3cc43c1579ddf44e4299d07
parent 332843 e1cf617a1f2813b6cd66f460313a61c223406c9b
child 514688 0dee36823c681548f1ee93faf0d4a026a36e9b10
push id11315
push userBogdan.Postelnicu@softvision.ro
push dateTue, 23 Feb 2016 07:45:09 +0000
reviewersmccr8
bugs1250134
milestone47.0a1
Bug 1250134 - assert mJSRuntime when IsGrayJS() is true. r?mccr8 MozReview-Commit-ID: B5046aj61jx
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -3278,16 +3278,17 @@ nsCycleCollector::CollectWhite()
   nsCycleCollectionParticipant* zoneParticipant =
     hasJSRuntime ? mJSRuntime->ZoneParticipant() : nullptr;
 
   NodePool::Enumerator etor(mGraph.mNodes);
   while (!etor.IsDone()) {
     PtrInfo* pinfo = etor.GetNext();
     if (pinfo->mColor == white && pinfo->mParticipant) {
       if (pinfo->IsGrayJS()) {
+        MOZ_ASSERT(mJSRuntime);
         ++numWhiteGCed;
         JS::Zone* zone;
         if (MOZ_UNLIKELY(pinfo->mParticipant == zoneParticipant)) {
           ++numWhiteJSZones;
           zone = static_cast<JS::Zone*>(pinfo->mPointer);
         } else {
           JS::GCCellPtr ptr(pinfo->mPointer, js::GCThingTraceKind(pinfo->mPointer));
           zone = JS::GetTenuredGCThingZone(ptr);