[scudo] Fix an edge case in the secondary allocator
authorKostya Kortchinsky <kostyak@google.com>
Fri, 30 Sep 2016 19:57:21 +0000 (19:57 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Fri, 30 Sep 2016 19:57:21 +0000 (19:57 +0000)
commitada27614074f52ffdecbdb8c493fb512105c594f
tree04a917e3b08a12ff0cbd78278a44acf44c2704f1
parent7a406e78b3b67a7f5cd694f0cdcce1a23216bca1
[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
compiler-rt/lib/scudo/scudo_allocator.cpp
compiler-rt/lib/scudo/scudo_allocator_secondary.h
compiler-rt/lib/scudo/scudo_utils.cpp
compiler-rt/test/scudo/malloc.cpp
compiler-rt/test/scudo/memalign.cpp
compiler-rt/test/scudo/realloc.cpp