summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray/xray_segmented_array.h
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-05-14 04:21:12 +0000
committerDean Michael Berris <dberris@google.com>2018-05-14 04:21:12 +0000
commit238aa1366e8c3a7b287172353e087700a983cf15 (patch)
tree19c2c561d456564a54178858864ae1fc6ae08734 /compiler-rt/lib/xray/xray_segmented_array.h
parent034b6c1a6638e492d08af0c0eac3c9dc7c8a1712 (diff)
downloadbcm5719-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.h3
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);
OpenPOWER on IntegriCloud