[compiler-rt] [ubsan] Introduce weak handle_error_begin and end hooks (PR #198916)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 01:57:29 PDT 2026


================
@@ -211,9 +211,26 @@ struct ReportOptions {
 
 bool ignoreReport(SourceLocation SLoc, ReportOptions Opts, ErrorType ET);
 
-#define GET_REPORT_OPTIONS(unrecoverable_handler) \
-    GET_CALLER_PC_BP; \
-    ReportOptions Opts = {unrecoverable_handler, pc, bp}
+// Called when a UBSan handler begins processing an error.
+// Used internally for running sanitizers at the same time as ubsan
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __ubsan_handle_error_begin(void);
+
+// Called when a UBSan handler finishes processing an error.
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __ubsan_handle_error_end(void);
+
----------------
davidtrevelyan wrote:

Sure - seems reasonable to me - very happy to go with your preference on this. @cjappl @fmayer are you both happy if we close this PR and merge https://github.com/llvm/llvm-project/pull/193585 instead? 

https://github.com/llvm/llvm-project/pull/198916


More information about the llvm-commits mailing list