diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp +++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp @@ -237,10 +237,10 @@ return mmap_interceptor(REAL(mmap), addr, sz, prot, flags, fd, off); \ } while (false) -# define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, munmap, addr, length) \ - do { \ - (void)(ctx); \ - return munmap_interceptor(REAL(munmap), addr, sz); \ +# define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, addr, length) \ + do { \ + (void)(ctx); \ + return munmap_interceptor(REAL(munmap), addr, sz); \ } while (false) # include "sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc" diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -27,6 +27,7 @@ // COMMON_INTERCEPTOR_HANDLE_RECVMSG // COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED // COMMON_INTERCEPTOR_MMAP_IMPL +// COMMON_INTERCEPTOR_MUNMAP_IMPL // COMMON_INTERCEPTOR_COPY_STRING // COMMON_INTERCEPTOR_STRNDUP_IMPL // COMMON_INTERCEPTOR_STRERROR @@ -297,7 +298,7 @@ #endif #ifndef COMMON_INTERCEPTOR_MUNMAP_IMPL -#define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, mmap, addr, sz) \ +#define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, addr, sz) \ { return REAL(munmap)(addr, sz); } #endif @@ -7412,7 +7413,7 @@ if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) return (int)internal_munmap(addr, sz); COMMON_INTERCEPTOR_ENTER(ctx, munmap, addr, sz); - COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, munmap, addr, sz); + COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, addr, sz); } INTERCEPTOR(int, mprotect, void *addr, SIZE_T sz, int prot) { diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp @@ -2505,9 +2505,9 @@ off); \ } while (false) -#define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, mmap, addr, sz) \ - do { \ - return munmap_interceptor(thr, pc, REAL(mmap), addr, sz); \ +#define COMMON_INTERCEPTOR_MUNMAP_IMPL(ctx, addr, sz) \ + do { \ + return munmap_interceptor(thr, pc, REAL(munmap), addr, sz); \ } while (false) #if !SANITIZER_APPLE