[compiler-rt] r332212 - [XRay][compiler-rt] Relocate a DCHECK to the correct location.

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Sun May 13 21:21:12 PDT 2018


Author: dberris
Date: Sun May 13 21:21:12 2018
New Revision: 332212

URL: http://llvm.org/viewvc/llvm-project?rev=332212&view=rev
Log:
[XRay][compiler-rt] Relocate a DCHECK to the correct location.

Fixes a bad DCHECK where the condition being checked is still valid (for
iterators pointing to sentinels).

Follow-up to D45756.

Modified:
    compiler-rt/trunk/lib/xray/xray_segmented_array.h

Modified: compiler-rt/trunk/lib/xray/xray_segmented_array.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_segmented_array.h?rev=332212&r1=332211&r2=332212&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_segmented_array.h (original)
+++ compiler-rt/trunk/lib/xray/xray_segmented_array.h Sun May 13 21:21:12 2018
@@ -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);




More information about the llvm-commits mailing list