[PATCH] D18397: [sanitizer] Add strnlen to the common interceptors

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 13:51:15 PDT 2016


samsonov added inline comments.

================
Comment at: lib/asan/asan_interceptors.cc:114
@@ -113,3 +113,3 @@
 static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) {
-#if ASAN_INTERCEPT_STRNLEN
+#if SANITIZER_INTERCEPT_STRNLEN
   if (REAL(strnlen)) {
----------------
bruening wrote:
> samsonov wrote:
> > I think SANITIZER_INTERCEPT_STRNLEN will not be defined at this point (sanitizer_common/sanitizer_common_interceptors.inc is #included later). Maybe we can just delete this terrible function and use internal_strnlen() everywhere instead. It won't be that much of a slowdown.
> No, it is defined: SANITIZER_INTERCEPT_STRNLEN is defined in sanitizer_platform_interceptors.h, not in sanitizer_common_interceptors.inc.  
> sanitizer_platform_interceptors.h is #included in asan_interceptors.h, which is #included at the top of this file.
Ah, good, thanks! It's fine to submit this change as-is then.


http://reviews.llvm.org/D18397





More information about the llvm-commits mailing list