[PATCH] D14283: [tsan] Allow memchr interceptor to be used before initialization on OS X

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 3 07:14:11 PST 2015


dvyukov added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:445
@@ -444,1 +444,3 @@
+  if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
+    return REAL(memchr)(s, c, n);
   void *ctx;
----------------
This is fragile (even if works for you). REAL interceptors are also initializes, so if nothing is initialized REAL(memchr) == 0. Call internal_memchr instead, like other cases do.


http://reviews.llvm.org/D14283





More information about the llvm-commits mailing list