summaryrefslogtreecommitdiff
path: root/libsanitizer/lsan
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2018-01-13 21:01:27 +0000
committerRainer Orth <ro@gcc.gnu.org>2018-01-13 21:01:27 +0000
commit1f7273e5dbd7e59cb97111d2d2bc73c896e12c1f (patch)
tree185838565b0af4b1c82f033264b064fd673e689c /libsanitizer/lsan
parentf208c5ccc76fe9f15776e62d466ccb8f565d2284 (diff)
downloadgcc-1f7273e5dbd7e59cb97111d2d2bc73c896e12c1f.tar.gz
Allow for lack of VM_MEMORY_OS_ALLOC_ONCE on Mac OS X (PR sanitizer/82824)
PR sanitizer/82824 * lsan/lsan_common_mac.cc: Cherry-pick upstream r322437. From-SVN: r256650
Diffstat (limited to 'libsanitizer/lsan')
-rw-r--r--libsanitizer/lsan/lsan_common_mac.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsanitizer/lsan/lsan_common_mac.cc b/libsanitizer/lsan/lsan_common_mac.cc
index e60b3d0f195..6e763dab7f8 100644
--- a/libsanitizer/lsan/lsan_common_mac.cc
+++ b/libsanitizer/lsan/lsan_common_mac.cc
@@ -22,6 +22,13 @@
#include <mach/mach.h>
+// Only introduced in Mac OS X 10.9.
+#ifdef VM_MEMORY_OS_ALLOC_ONCE
+static const int kSanitizerVmMemoryOsAllocOnce = VM_MEMORY_OS_ALLOC_ONCE;
+#else
+static const int kSanitizerVmMemoryOsAllocOnce = 73;
+#endif
+
namespace __lsan {
typedef struct {
@@ -155,7 +162,7 @@ void ProcessPlatformSpecificAllocations(Frontier *frontier) {
// libxpc stashes some pointers in the Kernel Alloc Once page,
// make sure not to report those as leaks.
- if (info.user_tag == VM_MEMORY_OS_ALLOC_ONCE) {
+ if (info.user_tag == kSanitizerVmMemoryOsAllocOnce) {
ScanRangeForPointers(address, end_address, frontier, "GLOBAL",
kReachable);