summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray/xray_segmented_array.h
diff options
context:
space:
mode:
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, 3 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_segmented_array.h b/compiler-rt/lib/xray/xray_segmented_array.h
index 11dd794fa52..dbbfc8e7843 100644
--- a/compiler-rt/lib/xray/xray_segmented_array.h
+++ b/compiler-rt/lib/xray/xray_segmented_array.h
@@ -325,6 +325,9 @@ public:
/// Remove N Elements from the end. This leaves the blocks behind, and not
/// require allocation of new blocks for new elements added after trimming.
void trim(size_t Elements) {
+ if (Elements == 0)
+ return;
+
DCHECK_LE(Elements, Size);
DCHECK_GT(Size, 0);
auto OldSize = Size;
OpenPOWER on IntegriCloud