[PATCH] D18020: [sanitizer] Add strlen to the common interceptors

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 15:59:26 PST 2016


bruening added inline comments.

================
Comment at: lib/asan/asan_flags.cc:162
@@ -161,1 +161,3 @@
   }
+  // Preserve the old meanings of flags from prior to moving interceptors
+  // from asan into the common set of interceptors.
----------------
samsonov wrote:
> Hm... I think I would prefer to break the old (non-default) use case rather than have this ugly workaround... As I understand it, we will gradually phase out ASAN_OPTIONS=replace_str flag anyway, so maybe we can get away with a warning instead:
> 
>   if (!f->replace_str && common_flags()->intercept_strlen) {
>     Report("WARNING: strlen interceptor is enabled even though replace_str=0. Use intercept_strlen=0 to disable it.");
>   }
Sure, I needed feedback on this one: did not want to break backward compatibility without a project owner signing off.

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:205
@@ +204,3 @@
+INTERCEPTOR(SIZE_T, strlen, const char *s) {
+  if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
+    return internal_strlen(s);
----------------
samsonov wrote:
> I don't think you need it here: looks like this will be handled by COMMON_INTERCEPTOR_ENTER macro.
Some common interceptors have their own init check which is what this is based on, but most don't and it does seem to be superfluous.  Perhaps I will send send a separate CL removing the existing checks.


http://reviews.llvm.org/D18020





More information about the llvm-commits mailing list