diff options
author | Dean Michael Berris <dberris@google.com> | 2018-05-14 04:21:12 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-05-14 04:21:12 +0000 |
commit | 238aa1366e8c3a7b287172353e087700a983cf15 (patch) | |
tree | 19c2c561d456564a54178858864ae1fc6ae08734 /compiler-rt/lib/xray/xray_segmented_array.h | |
parent | 034b6c1a6638e492d08af0c0eac3c9dc7c8a1712 (diff) | |
download | bcm5719-llvm-238aa1366e8c3a7b287172353e087700a983cf15.tar.gz bcm5719-llvm-238aa1366e8c3a7b287172353e087700a983cf15.zip |
[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
Diffstat (limited to 'compiler-rt/lib/xray/xray_segmented_array.h')
-rw-r--r-- | compiler-rt/lib/xray/xray_segmented_array.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_segmented_array.h b/compiler-rt/lib/xray/xray_segmented_array.h index a6ea31009c2..97d5ef51d54 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); |