Skip to content

Commit 238aa13

Browse files
committedMay 14, 2018
[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
1 parent 034b6c1 commit 238aa13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎compiler-rt/lib/xray/xray_segmented_array.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ struct Array {
143143
Iterator(Chunk *IC, size_t Off) : C(IC), Offset(Off) {}
144144

145145
Iterator &operator++() {
146-
DCHECK_NE(C, &SentinelChunk);
147146
if (++Offset % N)
148147
return *this;
149148

149+
DCHECK_NE(C, &SentinelChunk);
150+
150151
// At this point, we know that Offset % N == 0, so we must advance the
151152
// chunk pointer.
152153
DCHECK_EQ(Offset % N, 0);

0 commit comments

Comments
 (0)
Please sign in to comment.