From 0fa9d687403c67e6f284538fea53f57277ef5480 Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Fri, 7 Jul 2017 15:32:44 +0000 Subject: [PATCH] Fix-up for r307307: vm_info.max_address is the first non-addressable pointer, so we need to subtract one. llvm-svn: 307408 --- compiler-rt/lib/sanitizer_common/sanitizer_mac.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc index 8a8fc96..d6e61f2 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc @@ -815,7 +815,7 @@ uptr GetTaskInfoMaxAddress() { mach_msg_type_number_t count = sizeof(vm_info) / sizeof(int); int err = task_info(mach_task_self(), TASK_VM_INFO, (int *)&vm_info, &count); if (err == 0) { - return vm_info.max_address; + return vm_info.max_address - 1; } else { // xnu cannot provide vm address limit return 0x200000000 - 1; -- 2.7.4