[clang] [compiler-rt] [ubsan_minimal] Allow UBSan handler from Minimal runtime to acceprt arguments (PR #152192)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 10:17:26 PDT 2025
================
@@ -34,20 +34,25 @@ static char *append_hex(uintptr_t d, char *buf, const char *end) {
return buf;
}
-static void format_msg(const char *kind, uintptr_t caller, char *buf,
- const char *end) {
+static void format_msg(const char *kind, uintptr_t caller,
+ const uintptr_t *address, char *buf, const char *end) {
buf = append_str("ubsan: ", buf, end);
buf = append_str(kind, buf, end);
buf = append_str(" by 0x", buf, end);
buf = append_hex(caller, buf, end);
+ if (address) {
+ buf = append_str(" address 0x", buf, end);
+ buf = append_hex(*address, buf, end);
+ }
buf = append_str("\n", buf, end);
if (buf == end)
--buf; // Make sure we don't cause a buffer overflow.
*buf = '\0';
}
-SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error, const char *kind,
- uintptr_t caller) {
+SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_minimal_report_error,
+ const char *kind, uintptr_t caller,
+ const uintptr_t *address) {
----------------
vitalybuka wrote:
Let's not rename in this patch.
https://github.com/llvm/llvm-project/pull/152192
More information about the llvm-commits
mailing list