diff options
author | Kamil Rytarowski <n54@gmx.com> | 2018-11-07 20:19:53 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2018-11-07 20:19:53 +0000 |
commit | e06fb482a94f22e3cf66f4e3be0f6c500a3b7341 (patch) | |
tree | 8fad070adb7751ae0b278c3668bd3a513471f227 /compiler-rt/lib/sanitizer_common | |
parent | c4dfb42897da25afc5576bea838e530c635ae0f0 (diff) | |
download | bcm5719-llvm-e06fb482a94f22e3cf66f4e3be0f6c500a3b7341.tar.gz bcm5719-llvm-e06fb482a94f22e3cf66f4e3be0f6c500a3b7341.zip |
Split lgammal() from INIT_LGAMMAL
Summary:
Introduce SANITIZER_INTERCEPT_LGAMMAL
dedicated for lgammal(). Disable it for NetBSD
as this routine is not implemented in this OS.
Installation of supernumerary interceptors causes
leaking of errors to dlsym(3)-like operations.
Reviewers: joerg, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D54054
llvm-svn: 346352
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc | 15 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index e1ec699e388..e3f32c9f342 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -4876,6 +4876,14 @@ INTERCEPTOR(float, lgammaf, float x) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam)); return res; } +#define INIT_LGAMMA \ + COMMON_INTERCEPT_FUNCTION(lgamma); \ + COMMON_INTERCEPT_FUNCTION(lgammaf); +#else +#define INIT_LGAMMA +#endif + +#if SANITIZER_INTERCEPT_LGAMMAL INTERCEPTOR(long double, lgammal, long double x) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, lgammal, x); @@ -4883,12 +4891,10 @@ INTERCEPTOR(long double, lgammal, long double x) { COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &signgam, sizeof(signgam)); return res; } -#define INIT_LGAMMA \ - COMMON_INTERCEPT_FUNCTION(lgamma); \ - COMMON_INTERCEPT_FUNCTION(lgammaf); \ +#define INIT_LGAMMAL \ COMMON_INTERCEPT_FUNCTION_LDBL(lgammal); #else -#define INIT_LGAMMA +#define INIT_LGAMMAL #endif #if SANITIZER_INTERCEPT_LGAMMA_R @@ -7435,6 +7441,7 @@ static void InitializeCommonInterceptors() { INIT_REMQUO; INIT_REMQUOL; INIT_LGAMMA; + INIT_LGAMMAL; INIT_LGAMMA_R; INIT_LGAMMAL_R; INIT_DRAND48_R; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index 71dbb728b6a..851e8125025 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -362,6 +362,7 @@ #define SANITIZER_INTERCEPT_REMQUO SI_POSIX #define SANITIZER_INTERCEPT_REMQUOL (SI_POSIX && !SI_NETBSD) #define SANITIZER_INTERCEPT_LGAMMA SI_POSIX +#define SANITIZER_INTERCEPT_LGAMMAL (SI_POSIX && !SI_NETBSD) #define SANITIZER_INTERCEPT_LGAMMA_R (SI_FREEBSD || SI_LINUX || SI_SOLARIS) #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID || SI_SOLARIS #define SANITIZER_INTERCEPT_DRAND48_R SI_LINUX_NOT_ANDROID |