summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_report.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/asan/asan_report.cc')
-rw-r--r--compiler-rt/lib/asan/asan_report.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc
index 5baba45808e..4b7baa686e5 100644
--- a/compiler-rt/lib/asan/asan_report.cc
+++ b/compiler-rt/lib/asan/asan_report.cc
@@ -40,8 +40,6 @@ void AppendToErrorMessageBuffer(const char *buffer) {
}
}
-static void (*on_error_callback)(void);
-
// ---------------------- Helper functions ----------------------- {{{1
static void PrintBytes(const char *before, uptr *a) {
@@ -293,9 +291,7 @@ class ScopedInErrorReport {
}
Die();
}
- if (on_error_callback) {
- on_error_callback();
- }
+ __asan_on_error();
reporting_thread_tid = asanThreadRegistry().GetCurrentTidOrInvalid();
Printf("===================================================="
"=============\n");
@@ -492,6 +488,7 @@ void NOINLINE __asan_set_error_report_callback(void (*callback)(const char*)) {
}
}
-void NOINLINE __asan_set_on_error_callback(void (*callback)(void)) {
- on_error_callback = callback;
-}
+// Provide default implementation of __asan_on_error that does nothing
+// and may be overriden by user.
+SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE NOINLINE
+void __asan_on_error() {}
OpenPOWER on IntegriCloud