Bug 1282795 - Make a variable DebugOnly, and extract a side effect on that variable from an assertion expression to avoid a clang compiler warning when a side-effectful expression appears in unevaluated context. r=froydnj
authorJeff Walden <jwalden@mit.edu>
Tue, 28 Jun 2016 17:13:22 +0100
changeset 303019 6fef5909e6174def4b8d545dfd239a491055fa90
parent 303018 cd248c790c8c9d3ca3eba319858244259d7cba79
child 303020 00aadbafd1140805346013c0ab505a96294cbe25
push id78958
push userjwalden@mit.edu
push dateWed, 29 Jun 2016 09:35:06 +0000
treeherdermozilla-inbound@00aadbafd114 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1282795
milestone50.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 1282795 - Make a variable DebugOnly, and extract a side effect on that variable from an assertion expression to avoid a clang compiler warning when a side-effectful expression appears in unevaluated context. r=froydnj
js/src/jit/IonAnalysis.cpp
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -2861,19 +2861,20 @@ jit::AssertExtendedGraphCoherency(MIRGra
 #ifdef DEBUG
     if (!JitOptions.checkGraphConsistency)
         return;
 
     AssertGraphCoherency(graph);
 
     AssertDominatorTree(graph);
 
-    uint32_t idx = 0;
+    DebugOnly<uint32_t> idx = 0;
     for (MBasicBlockIterator block(graph.begin()); block != graph.end(); block++) {
-        MOZ_ASSERT(block->id() == idx++);
+        MOZ_ASSERT(block->id() == idx);
+        ++idx;
 
         // No critical edges:
         if (block->numSuccessors() > 1)
             for (size_t i = 0; i < block->numSuccessors(); i++)
                 MOZ_ASSERT(block->getSuccessor(i)->numPredecessors() == 1);
 
         if (block->isLoopHeader()) {
             if (underValueNumberer && block->numPredecessors() == 3) {