Fix-up for r307307: vm_info.max_address is the first non-addressable pointer, so...
authorKuba Mracek <mracek@apple.com>
Fri, 7 Jul 2017 15:32:44 +0000 (15:32 +0000)
committerKuba Mracek <mracek@apple.com>
Fri, 7 Jul 2017 15:32:44 +0000 (15:32 +0000)
llvm-svn: 307408

compiler-rt/lib/sanitizer_common/sanitizer_mac.cc

index 8a8fc96..d6e61f2 100644 (file)
@@ -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;