[PATCH] [ASan] Move the SIGSEGV/SIGBUS handling to sanitizer_common
Alexey Samsonov
samsonov at google.com
Fri Jan 31 05:01:31 PST 2014
LGTM (but please address nits)
================
Comment at: asan/asan_internal.h:74
@@ -73,2 +73,3 @@
void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp);
+void ASAN_OnSIGSEGV(int, void *siginfo, void *context);
----------------
AsanOnSIGSEGV
================
Comment at: asan/asan_interceptors.cc:206
@@ +205,3 @@
+
+extern "C" SANITIZER_WEAK_ATTRIBUTE int
+__sanitizer_sigaction_f(int signum, const void *act, void *oldact) {
----------------
You don't need WEAK here.
================
Comment at: sanitizer_common/sanitizer_posix_libcdep.cc:123
@@ +122,3 @@
+typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
+void MaybeInstallSigaction(int signum,
+ SignalHandlerType handler) {
----------------
static void MaybeInstallSigaction
================
Comment at: sanitizer_common/sanitizer_posix_libcdep.cc:140
@@ +139,3 @@
+ // will be actually set only once.
+ if (common_flags()->use_sigaltstack) __sanitizer::SetAlternateSignalStack();
+ MaybeInstallSigaction(SIGSEGV, handler);
----------------
remove __sanitizer::
http://llvm-reviews.chandlerc.com/D2640
More information about the llvm-commits
mailing list