OSDN Git Service

[sanitizer] Restrict querying VM size on Darwin only to iOS devices
authorKuba Mracek <mracek@apple.com>
Mon, 14 Dec 2020 18:48:48 +0000 (10:48 -0800)
committerKuba Mracek <mracek@apple.com>
Mon, 14 Dec 2020 18:48:48 +0000 (10:48 -0800)
We currently do this for SANITIZER_IOS, which includes devices *and* simulators. This change opts out the check for simulators to unify the behavior with macOS, because VM size is really a property of the host OS, and not the simulator.

<rdar://problem/72129387>

Differential Revision: https://reviews.llvm.org/D93140

compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp

index 62d422d..6fe6991 100644 (file)
@@ -1066,7 +1066,7 @@ char **GetArgv() {
   return *_NSGetArgv();
 }
 
-#if SANITIZER_IOS
+#if SANITIZER_IOS && !SANITIZER_IOSSIM
 // The task_vm_info struct is normally provided by the macOS SDK, but we need
 // fields only available in 10.12+. Declare the struct manually to be able to
 // build against older SDKs.