[compiler-rt] r350103 - Enable posix regex interceptors on linux.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 27 13:47:26 PST 2018


Author: eugenis
Date: Thu Dec 27 13:47:26 2018
New Revision: 350103

URL: http://llvm.org/viewvc/llvm-project?rev=350103&view=rev
Log:
Enable posix regex interceptors on linux.

Summary: They happen to work out of the box.

Reviewers: rtrieu, vitalybuka

Subscribers: kubamracek, fedor.sergeev, krytarowski, llvm-commits

Differential Revision: https://reviews.llvm.org/D56088

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
    compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/regex.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=350103&r1=350102&r2=350103&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Thu Dec 27 13:47:26 2018
@@ -522,7 +522,7 @@
 #define SANITIZER_INTERCEPT_GETMNTINFO (SI_NETBSD || SI_FREEBSD || SI_MAC)
 #define SANITIZER_INTERCEPT_MI_VECTOR_HASH SI_NETBSD
 #define SANITIZER_INTERCEPT_GETVFSSTAT SI_NETBSD
-#define SANITIZER_INTERCEPT_REGEX (SI_NETBSD || SI_FREEBSD)
+#define SANITIZER_INTERCEPT_REGEX (SI_NETBSD || SI_FREEBSD || SI_LINUX)
 #define SANITIZER_INTERCEPT_REGEXSUB SI_NETBSD
 #define SANITIZER_INTERCEPT_FTS (SI_NETBSD || SI_FREEBSD)
 #define SANITIZER_INTERCEPT_SYSCTL (SI_NETBSD || SI_FREEBSD || SI_MAC)

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=350103&r1=350102&r2=350103&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Thu Dec 27 13:47:26 2018
@@ -45,6 +45,7 @@
 #include <termios.h>
 #include <time.h>
 #include <wchar.h>
+#include <regex.h>
 #if !SANITIZER_MAC
 #include <utmp.h>
 #endif
@@ -189,6 +190,8 @@ namespace __sanitizer {
   unsigned struct_tms_sz = sizeof(struct tms);
   unsigned struct_sigevent_sz = sizeof(struct sigevent);
   unsigned struct_sched_param_sz = sizeof(struct sched_param);
+  unsigned struct_regex_sz = sizeof(regex_t);
+  unsigned struct_regmatch_sz = sizeof(regmatch_t);
 
 
 #if SANITIZER_MAC && !SANITIZER_IOS

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=350103&r1=350102&r2=350103&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Thu Dec 27 13:47:26 2018
@@ -49,6 +49,8 @@ namespace __sanitizer {
   extern unsigned struct_sigevent_sz;
   extern unsigned struct_sched_param_sz;
   extern unsigned struct_statfs64_sz;
+  extern unsigned struct_regex_sz;
+  extern unsigned struct_regmatch_sz;
 
 #if !SANITIZER_ANDROID
   extern unsigned struct_statfs_sz;

Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/regex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/regex.cc?rev=350103&r1=350102&r2=350103&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/regex.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/regex.cc Thu Dec 27 13:47:26 2018
@@ -1,6 +1,6 @@
 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
 //
-// UNSUPPORTED: linux, darwin, solaris
+// UNSUPPORTED: darwin, solaris
 
 #include <assert.h>
 #include <regex.h>




More information about the llvm-commits mailing list