summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/scudo_allocator_secondary.h
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2016-09-30 19:57:21 +0000
committerKostya Kortchinsky <kostyak@google.com>2016-09-30 19:57:21 +0000
commitada27614074f52ffdecbdb8c493fb512105c594f (patch)
tree04a917e3b08a12ff0cbd78278a44acf44c2704f1 /compiler-rt/lib/scudo/scudo_allocator_secondary.h
parent7a406e78b3b67a7f5cd694f0cdcce1a23216bca1 (diff)
downloadbcm5719-llvm-ada27614074f52ffdecbdb8c493fb512105c594f.tar.gz
bcm5719-llvm-ada27614074f52ffdecbdb8c493fb512105c594f.zip
[scudo] Fix an edge case in the secondary allocator
Summary: s/CHECK_LT/CHECK_LE/ in the secondary allocator, as under certain circumstances Ptr + Size can be equal to MapEnd. This edge case was not found by the current tests, so those were extended to be able to catch that. Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25101 llvm-svn: 282913
Diffstat (limited to 'compiler-rt/lib/scudo/scudo_allocator_secondary.h')
-rw-r--r--compiler-rt/lib/scudo/scudo_allocator_secondary.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/scudo/scudo_allocator_secondary.h b/compiler-rt/lib/scudo/scudo_allocator_secondary.h
index 220ce875e1d..ac739c8c25a 100644
--- a/compiler-rt/lib/scudo/scudo_allocator_secondary.h
+++ b/compiler-rt/lib/scudo/scudo_allocator_secondary.h
@@ -42,7 +42,7 @@ class ScudoLargeMmapAllocator {
uptr Ptr = MapBeg + sizeof(SecondaryHeader);
// TODO(kostyak): add a random offset to Ptr.
CHECK_GT(Ptr + Size, MapBeg);
- CHECK_LT(Ptr + Size, MapEnd);
+ CHECK_LE(Ptr + Size, MapEnd);
SecondaryHeader *Header = getHeader(Ptr);
Header->MapBeg = MapBeg - PageSize;
Header->MapSize = MapSize + 2 * PageSize;
OpenPOWER on IntegriCloud