[compiler-rt] [ubsan-minimal] Switch to weak symbols for callbacks to allow overriding in client code (PR #119242)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 13:00:26 PST 2024


================
@@ -0,0 +1,14 @@
+// RUN: %clang -fsanitize=implicit-integer-sign-change %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
+
+#include <stdio.h>
+#include <stdint.h>
+
+void __ubsan_handle_implicit_conversion_minimal() {
----------------
vitalybuka wrote:

Actually just 

```
NTERFACE void __ubsan_handle_##name##_minimal() {                           \
    uintptr_t caller = GET_CALLER_PC();                                        \
    if (!report_this_error(caller))                                            \
      return;                                                                  \
    char msg_buf[MSG_BUF_LEN(msg)] = MSG_TMPL(msg);                            \
    decorate_msg(MSG_TMPL_END(msg_buf, msg), caller);                          \
    __sanitizer_report_error_summary(msg_buf);                                 \
  }
```


With default implementation of     __sanitizer_report_error_summary as write

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


More information about the llvm-commits mailing list