From 238aa1366e8c3a7b287172353e087700a983cf15 Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Mon, 14 May 2018 04:21:12 +0000 Subject: [PATCH] [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. llvm-svn: 332212 --- compiler-rt/lib/xray/xray_segmented_array.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/xray/xray_segmented_array.h b/compiler-rt/lib/xray/xray_segmented_array.h index a6ea310..97d5ef5 100644 --- a/compiler-rt/lib/xray/xray_segmented_array.h +++ b/compiler-rt/lib/xray/xray_segmented_array.h @@ -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); -- 2.7.4