[compiler-rt] 6cf72ad - [NFC][asan] Don't unwind stack before pool check

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 02:00:46 PDT 2020


Author: Vitaly Buka
Date: 2020-08-28T02:00:35-07:00
New Revision: 6cf72ad3b3d4e475a25b7879f28996a78c8f62e5

URL: https://github.com/llvm/llvm-project/commit/6cf72ad3b3d4e475a25b7879f28996a78c8f62e5
DIFF: https://github.com/llvm/llvm-project/commit/6cf72ad3b3d4e475a25b7879f28996a78c8f62e5.diff

LOG: [NFC][asan] Don't unwind stack before pool check

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_malloc_linux.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_malloc_linux.cpp b/compiler-rt/lib/asan/asan_malloc_linux.cpp
index faa8968a5d00..cb6c0ced0494 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cpp
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cpp
@@ -120,19 +120,19 @@ static void *ReallocFromLocalPool(void *ptr, uptr size) {
 }
 
 INTERCEPTOR(void, free, void *ptr) {
-  GET_STACK_TRACE_FREE;
   if (UNLIKELY(IsInDlsymAllocPool(ptr))) {
     DeallocateFromLocalPool(ptr);
     return;
   }
+  GET_STACK_TRACE_FREE;
   asan_free(ptr, &stack, FROM_MALLOC);
 }
 
 #if SANITIZER_INTERCEPT_CFREE
 INTERCEPTOR(void, cfree, void *ptr) {
-  GET_STACK_TRACE_FREE;
   if (UNLIKELY(IsInDlsymAllocPool(ptr)))
     return;
+  GET_STACK_TRACE_FREE;
   asan_free(ptr, &stack, FROM_MALLOC);
 }
 #endif // SANITIZER_INTERCEPT_CFREE
@@ -304,4 +304,4 @@ void ReplaceSystemMalloc() {
 #endif  // SANITIZER_ANDROID
 
 #endif  // SANITIZER_FREEBSD || SANITIZER_FUCHSIA || SANITIZER_LINUX ||
-        // SANITIZER_NETBSD || SANITIZER_SOLARIS
+        // SANITIZER_NETBSD || SANITIZER_SOLARIS
\ No newline at end of file


        


More information about the llvm-commits mailing list