[sanitizer] Replace a macro with a function.

llvm-svn: 208207
This commit is contained in:
Evgeniy Stepanov 2014-05-07 13:24:28 +00:00
parent 9b74ec415b
commit 7d46040ff2
4 changed files with 138 additions and 138 deletions

View File

@ -723,7 +723,7 @@ void InitializeAsanInterceptors() {
static bool was_called_once;
CHECK(was_called_once == false);
was_called_once = true;
SANITIZER_COMMON_INTERCEPTORS_INIT;
InitializeCommonInterceptors();
// Intercept mem* functions.
ASAN_INTERCEPT_FUNC(memcmp);

View File

@ -1487,7 +1487,7 @@ void CopyPoison(void *dst, const void *src, uptr size, StackTrace *stack) {
void InitializeInterceptors() {
static int inited = 0;
CHECK_EQ(inited, 0);
SANITIZER_COMMON_INTERCEPTORS_INIT;
InitializeCommonInterceptors();
INTERCEPT_FUNCTION(mmap);
INTERCEPT_FUNCTION(mmap64);

View File

@ -3937,139 +3937,139 @@ INTERCEPTOR(void, _obstack_newchunk, __sanitizer_obstack *obstack, int length) {
#define INIT_OBSTACK
#endif
#define SANITIZER_COMMON_INTERCEPTORS_INIT \
INIT_TEXTDOMAIN; \
INIT_STRCMP; \
INIT_STRNCMP; \
INIT_STRCASECMP; \
INIT_STRNCASECMP; \
INIT_MEMCHR; \
INIT_MEMRCHR; \
INIT_READ; \
INIT_PREAD; \
INIT_PREAD64; \
INIT_READV; \
INIT_PREADV; \
INIT_PREADV64; \
INIT_WRITE; \
INIT_PWRITE; \
INIT_PWRITE64; \
INIT_WRITEV; \
INIT_PWRITEV; \
INIT_PWRITEV64; \
INIT_PRCTL; \
INIT_LOCALTIME_AND_FRIENDS; \
INIT_STRPTIME; \
INIT_SCANF; \
INIT_ISOC99_SCANF; \
INIT_PRINTF; \
INIT_ISOC99_PRINTF; \
INIT_FREXP; \
INIT_FREXPF_FREXPL; \
INIT_GETPWNAM_AND_FRIENDS; \
INIT_GETPWNAM_R_AND_FRIENDS; \
INIT_GETPWENT; \
INIT_FGETPWENT; \
INIT_GETPWENT_R; \
INIT_SETPWENT; \
INIT_CLOCK_GETTIME; \
INIT_GETITIMER; \
INIT_TIME; \
INIT_GLOB; \
INIT_WAIT; \
INIT_WAIT4; \
INIT_INET; \
INIT_PTHREAD_GETSCHEDPARAM; \
INIT_GETADDRINFO; \
INIT_GETNAMEINFO; \
INIT_GETSOCKNAME; \
INIT_GETHOSTBYNAME; \
INIT_GETHOSTBYNAME_R; \
INIT_GETSOCKOPT; \
INIT_ACCEPT; \
INIT_ACCEPT4; \
INIT_MODF; \
INIT_RECVMSG; \
INIT_GETPEERNAME; \
INIT_IOCTL; \
INIT_INET_ATON; \
INIT_SYSINFO; \
INIT_READDIR; \
INIT_READDIR64; \
INIT_PTRACE; \
INIT_SETLOCALE; \
INIT_GETCWD; \
INIT_GET_CURRENT_DIR_NAME; \
INIT_STRTOIMAX; \
INIT_MBSTOWCS; \
INIT_MBSNRTOWCS; \
INIT_WCSTOMBS; \
INIT_WCSNRTOMBS; \
INIT_TCGETATTR; \
INIT_REALPATH; \
INIT_CANONICALIZE_FILE_NAME; \
INIT_CONFSTR; \
INIT_SCHED_GETAFFINITY; \
INIT_STRERROR; \
INIT_STRERROR_R; \
INIT_XPG_STRERROR_R; \
INIT_SCANDIR; \
INIT_SCANDIR64; \
INIT_GETGROUPS; \
INIT_POLL; \
INIT_PPOLL; \
INIT_WORDEXP; \
INIT_SIGWAIT; \
INIT_SIGWAITINFO; \
INIT_SIGTIMEDWAIT; \
INIT_SIGSETOPS; \
INIT_SIGPENDING; \
INIT_SIGPROCMASK; \
INIT_BACKTRACE; \
INIT__EXIT; \
INIT_PTHREAD_MUTEX_LOCK; \
INIT_PTHREAD_MUTEX_UNLOCK; \
INIT_GETMNTENT; \
INIT_GETMNTENT_R; \
INIT_STATFS; \
INIT_STATFS64; \
INIT_STATVFS; \
INIT_STATVFS64; \
INIT_INITGROUPS; \
INIT_ETHER; \
INIT_ETHER_R; \
INIT_SHMCTL; \
INIT_RANDOM_R; \
INIT_PTHREAD_ATTR_GET; \
INIT_PTHREAD_ATTR_GETINHERITSCHED; \
INIT_PTHREAD_ATTR_GETAFFINITY_NP; \
INIT_TMPNAM; \
INIT_TMPNAM_R; \
INIT_TEMPNAM; \
INIT_PTHREAD_SETNAME_NP; \
INIT_SINCOS; \
INIT_REMQUO; \
INIT_LGAMMA; \
INIT_LGAMMA_R; \
INIT_DRAND48_R; \
INIT_RAND_R; \
INIT_GETLINE; \
INIT_ICONV; \
INIT_TIMES; \
INIT_TLS_GET_ADDR; \
INIT_LISTXATTR; \
INIT_GETXATTR; \
INIT_GETRESID; \
INIT_GETIFADDRS; \
INIT_IF_INDEXTONAME; \
INIT_CAPGET; \
INIT_AEABI_MEM; \
INIT___BZERO; \
INIT_FTIME; \
INIT_XDR; \
INIT_TSEARCH; \
INIT_LIBIO_INTERNALS; \
INIT_FOPEN; \
INIT_OPEN_MEMSTREAM; \
static void InitializeCommonInterceptors() {
INIT_TEXTDOMAIN;
INIT_STRCMP;
INIT_STRNCMP;
INIT_STRCASECMP;
INIT_STRNCASECMP;
INIT_MEMCHR;
INIT_MEMRCHR;
INIT_READ;
INIT_PREAD;
INIT_PREAD64;
INIT_READV;
INIT_PREADV;
INIT_PREADV64;
INIT_WRITE;
INIT_PWRITE;
INIT_PWRITE64;
INIT_WRITEV;
INIT_PWRITEV;
INIT_PWRITEV64;
INIT_PRCTL;
INIT_LOCALTIME_AND_FRIENDS;
INIT_STRPTIME;
INIT_SCANF;
INIT_ISOC99_SCANF;
INIT_PRINTF;
INIT_ISOC99_PRINTF;
INIT_FREXP;
INIT_FREXPF_FREXPL;
INIT_GETPWNAM_AND_FRIENDS;
INIT_GETPWNAM_R_AND_FRIENDS;
INIT_GETPWENT;
INIT_FGETPWENT;
INIT_GETPWENT_R;
INIT_SETPWENT;
INIT_CLOCK_GETTIME;
INIT_GETITIMER;
INIT_TIME;
INIT_GLOB;
INIT_WAIT;
INIT_WAIT4;
INIT_INET;
INIT_PTHREAD_GETSCHEDPARAM;
INIT_GETADDRINFO;
INIT_GETNAMEINFO;
INIT_GETSOCKNAME;
INIT_GETHOSTBYNAME;
INIT_GETHOSTBYNAME_R;
INIT_GETSOCKOPT;
INIT_ACCEPT;
INIT_ACCEPT4;
INIT_MODF;
INIT_RECVMSG;
INIT_GETPEERNAME;
INIT_IOCTL;
INIT_INET_ATON;
INIT_SYSINFO;
INIT_READDIR;
INIT_READDIR64;
INIT_PTRACE;
INIT_SETLOCALE;
INIT_GETCWD;
INIT_GET_CURRENT_DIR_NAME;
INIT_STRTOIMAX;
INIT_MBSTOWCS;
INIT_MBSNRTOWCS;
INIT_WCSTOMBS;
INIT_WCSNRTOMBS;
INIT_TCGETATTR;
INIT_REALPATH;
INIT_CANONICALIZE_FILE_NAME;
INIT_CONFSTR;
INIT_SCHED_GETAFFINITY;
INIT_STRERROR;
INIT_STRERROR_R;
INIT_XPG_STRERROR_R;
INIT_SCANDIR;
INIT_SCANDIR64;
INIT_GETGROUPS;
INIT_POLL;
INIT_PPOLL;
INIT_WORDEXP;
INIT_SIGWAIT;
INIT_SIGWAITINFO;
INIT_SIGTIMEDWAIT;
INIT_SIGSETOPS;
INIT_SIGPENDING;
INIT_SIGPROCMASK;
INIT_BACKTRACE;
INIT__EXIT;
INIT_PTHREAD_MUTEX_LOCK;
INIT_PTHREAD_MUTEX_UNLOCK;
INIT_GETMNTENT;
INIT_GETMNTENT_R;
INIT_STATFS;
INIT_STATFS64;
INIT_STATVFS;
INIT_STATVFS64;
INIT_INITGROUPS;
INIT_ETHER;
INIT_ETHER_R;
INIT_SHMCTL;
INIT_RANDOM_R;
INIT_PTHREAD_ATTR_GET;
INIT_PTHREAD_ATTR_GETINHERITSCHED;
INIT_PTHREAD_ATTR_GETAFFINITY_NP;
INIT_TMPNAM;
INIT_TMPNAM_R;
INIT_TEMPNAM;
INIT_PTHREAD_SETNAME_NP;
INIT_SINCOS;
INIT_REMQUO;
INIT_LGAMMA;
INIT_LGAMMA_R;
INIT_DRAND48_R;
INIT_RAND_R;
INIT_GETLINE;
INIT_ICONV;
INIT_TIMES;
INIT_TLS_GET_ADDR;
INIT_LISTXATTR;
INIT_GETXATTR;
INIT_GETRESID;
INIT_GETIFADDRS;
INIT_IF_INDEXTONAME;
INIT_CAPGET;
INIT_AEABI_MEM;
INIT___BZERO;
INIT_FTIME;
INIT_XDR;
INIT_TSEARCH;
INIT_LIBIO_INTERNALS;
INIT_FOPEN;
INIT_OPEN_MEMSTREAM;
INIT_OBSTACK;
/**/
}

View File

@ -2238,7 +2238,7 @@ void InitializeInterceptors() {
mallopt(1, 0); // M_MXFAST
mallopt(-3, 32*1024); // M_MMAP_THRESHOLD
SANITIZER_COMMON_INTERCEPTORS_INIT;
InitializeCommonInterceptors();
// We can not use TSAN_INTERCEPT to get setjmp addr,
// because it does &setjmp and setjmp is not present in some versions of libc.