diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp @@ -1185,6 +1185,7 @@ uptr GetMaxUserVirtualAddress() { static uptr max_vm = GetTaskInfoMaxAddress(); if (max_vm != 0) { + CHECK_LE(max_vm - 1, SANITIZER_MMAP_RANGE_SIZE); return max_vm - 1; }