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

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 11:18:34 PDT 2016


bruening 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)) {
----------------
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.


http://reviews.llvm.org/D18397





More information about the llvm-commits mailing list