[tsan] Add a max VM address check for Darwin/AArch64
authorKuba Mracek <mracek@apple.com>
Mon, 10 Jul 2017 15:24:48 +0000 (15:24 +0000)
committerKuba Mracek <mracek@apple.com>
Mon, 10 Jul 2017 15:24:48 +0000 (15:24 +0000)
Differential Revision: https://reviews.llvm.org/D35154

llvm-svn: 307540

compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc

index a82bcd0..e1ae0c0 100644 (file)
@@ -230,6 +230,14 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread,
 #endif
 
 void InitializePlatformEarly() {
+#if defined(__aarch64__)
+  uptr max_vm = GetMaxVirtualAddress() + 1;
+  if (max_vm != kHiAppMemEnd) {
+    Printf("ThreadSanitizer: unsupported vm address limit %p, expected %p.\n",
+           max_vm, kHiAppMemEnd);
+    Die();
+  }
+#endif
 }
 
 void InitializePlatform() {