summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-06-30 22:40:58 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-06-30 22:40:58 +0000
commitcffaa1c2989dd8a8dfd0229600c641f2c64336d2 (patch)
tree8b0e403b6d9e874784f2d23a961f9a0701d5d725 /compiler-rt/lib/sanitizer_common
parent38cae6330b3e41fb4c81f6fbdb98b4c8c5b159a8 (diff)
downloadbcm5719-llvm-cffaa1c2989dd8a8dfd0229600c641f2c64336d2.tar.gz
bcm5719-llvm-cffaa1c2989dd8a8dfd0229600c641f2c64336d2.zip
Fix apparent thinko in r209744: allocator stats can be zero
llvm-svn: 212071
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_allocator.h4
1 files 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 0172e73a705..c83c6724e59 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:
OpenPOWER on IntegriCloud