[compiler-rt] 7ebfc36 - [Sanitizers] Remove unused parameter from COMMON_INTERCEPTOR_MUNMAP_IMPL

Kirill Stoimenov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 16:19:24 PDT 2023


Author: Kirill Stoimenov
Date: 2023-06-15T23:19:04Z
New Revision: 7ebfc36f7e68a4405680cb651356a37fa359303a

URL: https://github.com/llvm/llvm-project/commit/7ebfc36f7e68a4405680cb651356a37fa359303a
DIFF: https://github.com/llvm/llvm-project/commit/7ebfc36f7e68a4405680cb651356a37fa359303a.diff

LOG: [Sanitizers] Remove unused parameter from COMMON_INTERCEPTOR_MUNMAP_IMPL

This was a result of copy/paste from the MMAP interceptor which uses the parameter to swtich between mmap and mmap64.

Reviewed By: vitalybuka

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

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_interceptors.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
index fab21b2e85a78..1a49320b0719e 100644
--- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
@@ -237,10 +237,10 @@ static int munmap_interceptor(Munmap real_munmap, void *addr, SIZE_T length) {
         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
index 5b08f08824149..299561b3ad3a1 100644
--- 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 @@ extern const short *_tolower_tab_;
 #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 @@ INTERCEPTOR(int, munmap, void *addr, SIZE_T sz) {
   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
index 10faf40dcf644..44d20e7ca690d 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -2505,9 +2505,9 @@ static void HandleRecvmsg(ThreadState *thr, uptr pc,
                             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


        


More information about the llvm-commits mailing list