[compiler-rt] a489d6c - [ASan] Moved __asan_test_only_reported_buggy_pointer to ReportGenericError, which is needed for shared optimzied callback tests.

Kirill Stoimenov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 09:54:33 PST 2021


Author: Kirill Stoimenov
Date: 2021-11-24T09:54:13-08:00
New Revision: a489d6c5e0158eb92025b27bce958595c20d3ecf

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

LOG: [ASan] Moved __asan_test_only_reported_buggy_pointer to ReportGenericError, which is needed for shared optimzied callback tests.

Reviewed By: vitalybuka

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

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_report.cpp
    compiler-rt/lib/asan/asan_rtl.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_report.cpp b/compiler-rt/lib/asan/asan_report.cpp
index 1f266334b3115..2a38fabaf220a 100644
--- a/compiler-rt/lib/asan/asan_report.cpp
+++ b/compiler-rt/lib/asan/asan_report.cpp
@@ -460,6 +460,10 @@ static bool SuppressErrorReport(uptr pc) {
 
 void ReportGenericError(uptr pc, uptr bp, uptr sp, uptr addr, bool is_write,
                         uptr access_size, u32 exp, bool fatal) {
+  if (__asan_test_only_reported_buggy_pointer) {
+    *__asan_test_only_reported_buggy_pointer = addr;
+    return;
+  }
   if (!fatal && SuppressErrorReport(pc)) return;
   ENABLE_FRAME_POINTER;
 

diff  --git a/compiler-rt/lib/asan/asan_rtl.cpp b/compiler-rt/lib/asan/asan_rtl.cpp
index 1b150b393cfe0..5be8ef0f6d1c2 100644
--- a/compiler-rt/lib/asan/asan_rtl.cpp
+++ b/compiler-rt/lib/asan/asan_rtl.cpp
@@ -85,12 +85,8 @@ void ShowStatsAndAbort() {
 NOINLINE
 static void ReportGenericErrorWrapper(uptr addr, bool is_write, int size,
                                       int exp_arg, bool fatal) {
-  if (__asan_test_only_reported_buggy_pointer) {
-    *__asan_test_only_reported_buggy_pointer = addr;
-  } else {
-    GET_CALLER_PC_BP_SP;
-    ReportGenericError(pc, bp, sp, addr, is_write, size, exp_arg, fatal);
-  }
+  GET_CALLER_PC_BP_SP;
+  ReportGenericError(pc, bp, sp, addr, is_write, size, exp_arg, fatal);
 }
 
 // --------------- LowLevelAllocateCallbac ---------- {{{1


        


More information about the llvm-commits mailing list