From 8b225456c2d553d060fe7d9a8813af27b4a015f8 Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Mon, 10 Jul 2017 15:24:48 +0000 Subject: [PATCH] [tsan] Add a max VM address check for Darwin/AArch64 Differential Revision: https://reviews.llvm.org/D35154 llvm-svn: 307540 --- compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc index a82bcd0..e1ae0c0 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc @@ -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() { -- 2.7.4