[XRay][compiler-rt] Relocate a DCHECK to the correct location.
authorDean Michael Berris <dberris@google.com>
Mon, 14 May 2018 04:21:12 +0000 (04:21 +0000)
committerDean Michael Berris <dberris@google.com>
Mon, 14 May 2018 04:21:12 +0000 (04:21 +0000)
Fixes a bad DCHECK where the condition being checked is still valid (for
iterators pointing to sentinels).

Follow-up to D45756.

llvm-svn: 332212

compiler-rt/lib/xray/xray_segmented_array.h

index a6ea310..97d5ef5 100644 (file)
@@ -143,10 +143,11 @@ private:
     Iterator(Chunk *IC, size_t Off) : C(IC), Offset(Off) {}
 
     Iterator &operator++() {
-      DCHECK_NE(C, &SentinelChunk);
       if (++Offset % N)
         return *this;
 
+      DCHECK_NE(C, &SentinelChunk);
+
       // At this point, we know that Offset % N == 0, so we must advance the
       // chunk pointer.
       DCHECK_EQ(Offset % N, 0);