AddressSanitizer: revert r150683 - we can't get rid of headers that easily
llvm-svn: 150699
This commit is contained in:
parent
3fc6e4a7cd
commit
fbb50f19ad
|
|
@ -34,11 +34,11 @@
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// FIXME(samsonov): Gradually replace system headers with declarations of
|
// FIXME(samsonov): Gradually replace system headers with declarations of
|
||||||
// intercepted functions. We need these declarations on Mac to get addresses of
|
// intercepted functions.
|
||||||
// the functions to intercept.
|
#include <pthread.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
namespace __asan {
|
namespace __asan {
|
||||||
|
|
@ -218,10 +218,8 @@ static void *asan_thread_start(void *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
extern "C"
|
INTERCEPTOR(int, pthread_create, pthread_t *thread,
|
||||||
int pthread_create(void *thread, const void *attr,
|
const pthread_attr_t *attr,
|
||||||
void *(*start_routine)(void*), void *arg);
|
|
||||||
INTERCEPTOR(int, pthread_create, void *thread, const void *attr,
|
|
||||||
void *(*start_routine)(void*), void *arg) {
|
void *(*start_routine)(void*), void *arg) {
|
||||||
GET_STACK_TRACE_HERE(kStackTraceMax);
|
GET_STACK_TRACE_HERE(kStackTraceMax);
|
||||||
int current_tid = asanThreadRegistry().GetCurrentTidOrMinusOne();
|
int current_tid = asanThreadRegistry().GetCurrentTidOrMinusOne();
|
||||||
|
|
@ -239,9 +237,8 @@ INTERCEPTOR(void*, signal, int signum, void *handler) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act,
|
||||||
int sigaction(int signum, const void *act, void *oldact);
|
struct sigaction *oldact) {
|
||||||
INTERCEPTOR(int, sigaction, int signum, const void *act, void *oldact) {
|
|
||||||
if (!AsanInterceptsSignal(signum)) {
|
if (!AsanInterceptsSignal(signum)) {
|
||||||
return REAL(sigaction)(signum, act, oldact);
|
return REAL(sigaction)(signum, act, oldact);
|
||||||
}
|
}
|
||||||
|
|
@ -396,7 +393,8 @@ DEFINE_REAL(char*, index, const char *string, int c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
DEFINE_REAL(int, sigaction, int signum, const void *act, void *oldact);
|
DEFINE_REAL(int, sigaction, int signum, const struct sigaction *act,
|
||||||
|
struct sigaction *oldact);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
|
INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ DECLARE_REAL(char*, strchr, const char *str, int c);
|
||||||
DECLARE_REAL(size_t, strlen, const char *s);
|
DECLARE_REAL(size_t, strlen, const char *s);
|
||||||
DECLARE_REAL(char*, strncpy, char *to, const char *from, size_t size);
|
DECLARE_REAL(char*, strncpy, char *to, const char *from, size_t size);
|
||||||
DECLARE_REAL(size_t, strnlen, const char *s, size_t maxlen);
|
DECLARE_REAL(size_t, strnlen, const char *s, size_t maxlen);
|
||||||
DECLARE_REAL(int, sigaction, int signum, const void *act, void *oldact);
|
struct sigaction;
|
||||||
|
DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act,
|
||||||
|
struct sigaction *oldact);
|
||||||
|
|
||||||
namespace __asan {
|
namespace __asan {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue