diff options
author | David Carlier <devnexen@gmail.com> | 2018-12-22 11:17:27 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2018-12-22 11:17:27 +0000 |
commit | c697faffde242dc19a39c508785dae8c305bfd2a (patch) | |
tree | 2464f7cc3f7d962f27dc25e670a26c015ff579aa /lib/sanitizer_common/sanitizer_common_interceptors.inc | |
parent | 2835fe7cf7dc2add5f2c93f4f6470b0f07863c28 (diff) | |
download | compiler-rt-c697faffde242dc19a39c508785dae8c305bfd2a.tar.gz |
[Sanitizer] Enable POSIX regex api on FreeBSD.
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D56009
M lib/sanitizer_common/sanitizer_common_interceptors.inc
M lib/sanitizer_common/sanitizer_platform_interceptors.h
M lib/sanitizer_common/sanitizer_platform_limits_freebsd.cc
M lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
D test/sanitizer_common/TestCases/NetBSD/regex.cc
A + test/sanitizer_common/TestCases/Posix/regex.cc
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_interceptors.inc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common_interceptors.inc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors.inc b/lib/sanitizer_common/sanitizer_common_interceptors.inc index ff378e1e9..1f446feba 100644 --- a/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -7421,6 +7421,16 @@ INTERCEPTOR(void, regfree, const void *preg) { COMMON_INTERCEPTOR_READ_RANGE(ctx, preg, struct_regex_sz); REAL(regfree)(preg); } +#define INIT_REGEX \ + COMMON_INTERCEPT_FUNCTION(regcomp); \ + COMMON_INTERCEPT_FUNCTION(regexec); \ + COMMON_INTERCEPT_FUNCTION(regerror); \ + COMMON_INTERCEPT_FUNCTION(regfree); +#else +#define INIT_REGEX +#endif + +#if SANITIZER_INTERCEPT_REGEXSUB INTERCEPTOR(SSIZE_T, regnsub, char *buf, SIZE_T bufsiz, const char *sub, const struct __sanitizer_regmatch *rm, const char *str) { void *ctx; @@ -7455,15 +7465,12 @@ INTERCEPTOR(SSIZE_T, regasub, char **buf, const char *sub, } return res; } -#define INIT_REGEX \ - COMMON_INTERCEPT_FUNCTION(regcomp); \ - COMMON_INTERCEPT_FUNCTION(regexec); \ - COMMON_INTERCEPT_FUNCTION(regerror); \ - COMMON_INTERCEPT_FUNCTION(regfree); \ + +#define INIT_REGEXSUB \ COMMON_INTERCEPT_FUNCTION(regnsub); \ COMMON_INTERCEPT_FUNCTION(regasub); #else -#define INIT_REGEX +#define INIT_REGEXSUB #endif #if SANITIZER_INTERCEPT_FTS @@ -9297,6 +9304,7 @@ static void InitializeCommonInterceptors() { INIT_SETVBUF; INIT_GETVFSSTAT; INIT_REGEX; + INIT_REGEXSUB; INIT_FTS; INIT_SYSCTL; INIT_ASYSCTL; |