Bug 1400374 - Fix compiler warning in FixGrayBits. r=smaug draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 15 Sep 2017 13:01:15 -0700
changeset 666360 9ce83c87e2fd1394277213c0cfc439f28f739bdc
parent 666359 6db139aa76584cdf2810f7860783321898cbec87
child 732080 bf51efd172cc073f5b0caf6e31d33b7c14c97068
push id80382
push userbmo:continuation@gmail.com
push dateMon, 18 Sep 2017 17:13:46 +0000
reviewerssmaug
bugs1400374
milestone57.0a1
Bug 1400374 - Fix compiler warning in FixGrayBits. r=smaug The compiler complains because a postfix increment is done inside of an assert. MozReview-Commit-ID: LSRsWMn9Tlj
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -3606,17 +3606,18 @@ nsCycleCollector::FixGrayBits(bool aForc
     mCCJSRuntime->GarbageCollect(aForceGC ? JS::gcreason::SHUTDOWN_CC :
                                           JS::gcreason::CC_FORCED);
 
     mCCJSRuntime->FixWeakMappingGrayBits();
 
     // It's possible that FixWeakMappingGrayBits will hit OOM when unmarking
     // gray and we will have to go round again. The second time there should not
     // be any weak mappings to fix up so the loop body should run at most twice.
-    MOZ_RELEASE_ASSERT(count++ < 2);
+    MOZ_RELEASE_ASSERT(count < 2);
+    count++;
   } while (!mCCJSRuntime->AreGCGrayBitsValid());
 
   aTimeLog.Checkpoint("FixGrayBits");
 }
 
 bool
 nsCycleCollector::IsIncrementalGCInProgress()
 {