[compiler-rt] [hwasan] Call user provided callback function for both fatal and non-… (PR #80429)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 04:06:52 PST 2024


https://github.com/Enna1 updated https://github.com/llvm/llvm-project/pull/80429

>From 37b4c41fba9a4aa4b803eedb0d32bd4ca0c0072f Mon Sep 17 00:00:00 2001
From: "xumingjie.enna1" <xumingjie.enna1 at bytedance.com>
Date: Fri, 2 Feb 2024 21:01:33 +0800
Subject: [PATCH] [hwasan] Call user provided callback function for both fatal
 and non-fatal error report

This makes the behavior of HWASan matching with ASan: always call user provided callback function for an error report, but only call `SetAbortMessage()` on Android when `flags()->halt_on_error` is true.
---
 compiler-rt/lib/hwasan/hwasan_report.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp
index 12a4fa47f2151..54bf8247ceeb3 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -40,7 +40,7 @@ class ScopedReport {
  public:
   explicit ScopedReport(bool fatal) : fatal(fatal) {
     Lock lock(&error_message_lock_);
-    error_message_ptr_ = fatal ? &error_message_ : nullptr;
+    error_message_ptr_ = &error_message_;
     ++hwasan_report_count;
   }
 



More information about the llvm-commits mailing list