diff options
author | Kamil Rytarowski <n54@gmx.com> | 2018-11-07 20:18:36 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2018-11-07 20:18:36 +0000 |
commit | c4dfb42897da25afc5576bea838e530c635ae0f0 (patch) | |
tree | 5ce20e5e87ee6c7593a8e9e0ecf63e40e0063f8f /compiler-rt/lib/sanitizer_common | |
parent | f9a02a7006f27c14a8ac69d380649fbddfb72538 (diff) | |
download | bcm5719-llvm-c4dfb42897da25afc5576bea838e530c635ae0f0.tar.gz bcm5719-llvm-c4dfb42897da25afc5576bea838e530c635ae0f0.zip |
Split remquol() from INIT_REMQUO
Summary:
Introduce SANITIZER_INTERCEPT_REMQUOL
dedicated for remquol(). Disable for 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/D54051
llvm-svn: 346351
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 631df04588d..e1ec699e388 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -4836,6 +4836,14 @@ INTERCEPTOR(float, remquof, float x, float y, int *quo) { if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo)); return res; } +#define INIT_REMQUO \ + COMMON_INTERCEPT_FUNCTION(remquo); \ + COMMON_INTERCEPT_FUNCTION(remquof); +#else +#define INIT_REMQUO +#endif + +#if SANITIZER_INTERCEPT_REMQUOL INTERCEPTOR(long double, remquol, long double x, long double y, int *quo) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, remquol, x, y, quo); @@ -4846,12 +4854,10 @@ INTERCEPTOR(long double, remquol, long double x, long double y, int *quo) { if (quo) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, quo, sizeof(*quo)); return res; } -#define INIT_REMQUO \ - COMMON_INTERCEPT_FUNCTION(remquo); \ - COMMON_INTERCEPT_FUNCTION(remquof); \ +#define INIT_REMQUOL \ COMMON_INTERCEPT_FUNCTION_LDBL(remquol); #else -#define INIT_REMQUO +#define INIT_REMQUOL #endif #if SANITIZER_INTERCEPT_LGAMMA @@ -7427,6 +7433,7 @@ static void InitializeCommonInterceptors() { INIT_PTHREAD_GETNAME_NP; INIT_SINCOS; INIT_REMQUO; + INIT_REMQUOL; INIT_LGAMMA; INIT_LGAMMA_R; INIT_LGAMMAL_R; diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index c05f35c583b..71dbb728b6a 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -360,6 +360,7 @@ #define SANITIZER_INTERCEPT_TEMPNAM SI_POSIX #define SANITIZER_INTERCEPT_SINCOS SI_LINUX || SI_SOLARIS #define SANITIZER_INTERCEPT_REMQUO SI_POSIX +#define SANITIZER_INTERCEPT_REMQUOL (SI_POSIX && !SI_NETBSD) #define SANITIZER_INTERCEPT_LGAMMA SI_POSIX #define SANITIZER_INTERCEPT_LGAMMA_R (SI_FREEBSD || SI_LINUX || SI_SOLARIS) #define SANITIZER_INTERCEPT_LGAMMAL_R SI_LINUX_NOT_ANDROID || SI_SOLARIS |