From cffaa1c2989dd8a8dfd0229600c641f2c64336d2 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 30 Jun 2014 22:40:58 +0000 Subject: [PATCH] Fix apparent thinko in r209744: allocator stats can be zero llvm-svn: 212071 --- compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h index 0172e73..c83c672 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h @@ -273,9 +273,9 @@ class AllocatorGlobalStats : public AllocatorStats { if (stats == this) break; } - // All stats must be positive. + // All stats must be non-negative. for (int i = 0; i < AllocatorStatCount; i++) - s[i] = ((sptr)s[i]) > 0 ? s[i] : 1; + s[i] = ((sptr)s[i]) >= 0 ? s[i] : 0; } private: -- 2.7.4