From c358e51e9b9d42be542ae577d10b851e9358cd39 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 20 Jul 2018 17:07:35 +0000 Subject: [PATCH] On Darwin switch from the `VM_MEMORY_ANALYSIS_TOOL` VM tag to `VM_MEMORY_SANITIZER`. It turns out that `VM_MEMORY_ANALYSIS_TOOL` is already reserved for use by other tools so switch to a tag reserved for use by the Sanitizers. rdar://problem/41969783 Differential Revision: https://reviews.llvm.org/D49603 llvm-svn: 337579 --- compiler-rt/lib/sanitizer_common/sanitizer_mac.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc index c613a6a..180d7c1 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc @@ -102,9 +102,15 @@ extern "C" void *__mmap(void *addr, size_t len, int prot, int flags, int fildes, extern "C" int __munmap(void *, size_t) SANITIZER_WEAK_ATTRIBUTE; // ---------------------- sanitizer_libc.h + +// From , but not on older OSs. +#ifndef VM_MEMORY_SANITIZER +#define VM_MEMORY_SANITIZER 99 +#endif + uptr internal_mmap(void *addr, size_t length, int prot, int flags, int fd, u64 offset) { - if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_ANALYSIS_TOOL); + if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_SANITIZER); if (&__mmap) return (uptr)__mmap(addr, length, prot, flags, fd, offset); return (uptr)mmap(addr, length, prot, flags, fd, offset); } -- 2.7.4