Skip to content

Commit 418204d

Browse files
authored
Revert "[UBSan] [compiler-rt] add preservecc variants of handlers" (#168973)
Reverts #168643
1 parent 49e46a5 commit 418204d

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,6 @@ SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error, const char *kind,
8989
}
9090
}
9191

92-
SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error_preserve,
93-
const char *kind, uintptr_t caller,
94-
const uintptr_t *address)
95-
[[clang::preserve_all]] {
96-
// Additional indirecton so the user can override this with their own
97-
// preserve_all function. This would allow, e.g., a function that reports the
98-
// first error only, so for all subsequent calls we can skip the register save
99-
// / restore.
100-
__ubsan_report_error(kind, caller, address);
101-
}
102-
10392
SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error_fatal, const char *kind,
10493
uintptr_t caller, const uintptr_t *address) {
10594
// Use another handlers, in case it's already overriden.
@@ -141,10 +130,6 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
141130
#define HANDLER_RECOVER(name, kind) \
142131
INTERFACE void __ubsan_handle_##name##_minimal() { \
143132
__ubsan_report_error(kind, GET_CALLER_PC(), nullptr); \
144-
} \
145-
INTERFACE void __ubsan_handle_##name##_minimal_preserve() \
146-
[[clang::preserve_all]] { \
147-
__ubsan_report_error_preserve(kind, GET_CALLER_PC(), nullptr); \
148133
}
149134

150135
#define HANDLER_NORECOVER(name, kind) \
@@ -161,10 +146,6 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
161146
#define HANDLER_RECOVER_PTR(name, kind) \
162147
INTERFACE void __ubsan_handle_##name##_minimal(const uintptr_t address) { \
163148
__ubsan_report_error(kind, GET_CALLER_PC(), &address); \
164-
} \
165-
INTERFACE void __ubsan_handle_##name##_minimal_preserve( \
166-
const uintptr_t address) [[clang::preserve_all]] { \
167-
__ubsan_report_error_preserve(kind, GET_CALLER_PC(), &address); \
168149
}
169150

170151
#define HANDLER_NORECOVER_PTR(name, kind) \

compiler-rt/test/ubsan_minimal/TestCases/test-darwin-interface.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// REQUIRES: x86_64-darwin
55

66
// RUN: nm -jgU `%clangxx_min_runtime -fsanitize-minimal-runtime -fsanitize=undefined %s -o %t '-###' 2>&1 | grep "libclang_rt.ubsan_minimal_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.ubsan_minimal_osx_dynamic.dylib\)".*/\1/'` | grep "^___ubsan_handle" \
7-
// RUN: | grep -vE "_minimal_preserve" \
87
// RUN: | sed 's/_minimal//g' \
98
// RUN: > %t.minimal.symlist
109
//

0 commit comments

Comments
 (0)