forked from OSchip/llvm-project
[Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h
llvm-svn: 177155
This commit is contained in:
parent
9aecdfe34d
commit
3a6b6b9d55
|
@ -79,9 +79,9 @@ using __sanitizer::uptr;
|
|||
# define ASAN_INTERCEPT___CXA_THROW 0
|
||||
#endif
|
||||
|
||||
// Windows threads.
|
||||
# if defined(_WIN32)
|
||||
extern "C" {
|
||||
// Windows threads.
|
||||
__declspec(dllimport)
|
||||
void* __stdcall CreateThread(void *sec, uptr st, void* start,
|
||||
void *arg, DWORD fl, DWORD *id);
|
||||
|
@ -103,6 +103,7 @@ int atoi(const char *nptr);
|
|||
long atol(const char *nptr); // NOLINT
|
||||
long strtol(const char *nptr, char **endptr, int base); // NOLINT
|
||||
void longjmp(void *env, int value);
|
||||
double frexp(double x, int *expptr);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
|
|
@ -37,6 +37,12 @@ INTERCEPTOR(double, frexp, double x, int *exp) {
|
|||
return res;
|
||||
}
|
||||
|
||||
#define INIT_FREXP INTERCEPT_FUNCTION(frexp);
|
||||
#else
|
||||
#define INIT_FREXP
|
||||
#endif // SANITIZER_INTERCEPT_FREXP
|
||||
|
||||
#if SANITIZER_INTERCEPT_FREXPF_FREXPL
|
||||
INTERCEPTOR(float, frexpf, float x, int *exp) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_ENTER(ctx, frexpf, x, exp);
|
||||
|
@ -53,13 +59,12 @@ INTERCEPTOR(long double, frexpl, long double x, int *exp) {
|
|||
return res;
|
||||
}
|
||||
|
||||
#define INIT_FREXP \
|
||||
INTERCEPT_FUNCTION(frexp); \
|
||||
#define INIT_FREXPF_FREXPL \
|
||||
INTERCEPT_FUNCTION(frexpf); \
|
||||
INTERCEPT_FUNCTION(frexpl)
|
||||
#else
|
||||
#define INIT_FREXP
|
||||
#endif // SANITIZER_INTERCEPT_FREXP
|
||||
#define INIT_FREXPF_FREXPL
|
||||
#endif // SANITIZER_INTERCEPT_FREXPF_FREXPL
|
||||
|
||||
#if SANITIZER_INTERCEPT_READ
|
||||
INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
|
||||
|
@ -370,4 +375,5 @@ SCANF_INTERCEPTOR_IMPL(__isoc99_sscanf, __isoc99_vsscanf, str, format)
|
|||
INIT_PWRITE64; \
|
||||
INIT_LOCALTIME_AND_FRIENDS; \
|
||||
INIT_SCANF; \
|
||||
INIT_FREXP;
|
||||
INIT_FREXP; \
|
||||
INIT_FREXPF_FREXPL;
|
||||
|
|
|
@ -48,3 +48,4 @@
|
|||
# define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX
|
||||
|
||||
# define SANITIZER_INTERCEPT_FREXP 1
|
||||
# define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS
|
||||
|
|
Loading…
Reference in New Issue