[PATCH] D19875: [sanitizer] Move stat/__xstat to the common interceptors

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 11:24:38 PDT 2016


eugenis added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:5520
@@ -5519,1 +5519,3 @@
 
+#if SANITIZER_INTERCEPT_STAT
+INTERCEPTOR(int, stat, const char *path, void *buf) {
----------------
aizatsky wrote:
> The direction of this CL is good. I worry that stat/xstat behavior is not really clear.
> 
> Other interceptors (e.g. SANITIZER_INTERCEPT_STRCHR) are completely enabled/disabled by a guard. In this case it is not fully enabled/disabled, but an implementation is switched.
> 
> I suggest having two guards: one that turns it on/off, the other one chooses the implementation. WDYT?
These are actually independent interceptors, use
SANITIZER_INTERCEPT_STAT
and
SANITIZER_INTERCEPT___XSTAT


================
Comment at: lib/sanitizer_common/sanitizer_platform_interceptors.h:40
@@ -33,2 +39,3 @@
 # define SI_FREEBSD 1
+# define SI_NOT_FREEBSD 0
 #else
----------------
This is not used anywhere.
Just use !SI_FREEBSD instead, it is shorter.


Repository:
  rL LLVM

http://reviews.llvm.org/D19875





More information about the llvm-commits mailing list