Skip to content

Commit 5948c0e

Browse files
committed
Include heap_start in check too
1 parent 2478b34 commit 5948c0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class SizeClassAllocator64 {
122122
// TODO: hypothetical edge case: on >48-bit VMA systems, Linux by default
123123
// maps as if it was a 48-bit VMA, but a sanitizer could
124124
// theoretically map beyond the 48-bit limit (N.B. 2**48 == 256TB).
125-
if (TotalSpaceSize >= MaxAddr) {
125+
if (heap_start + TotalSpaceSize >= MaxAddr) {
126126
// We can't easily adjust the requested heap size, because kSpaceSize is
127127
// const (for optimization) and used throughout the code.
128128
VReport(0, "Error: heap size %zx exceeds max user virtual address %zx\n",

0 commit comments

Comments
 (0)