[llvm-commits] [compiler-rt] r163493 - /compiler-rt/trunk/lib/asan/asan_interceptors.cc
Alexander Potapenko
glider at google.com
Mon Sep 10 01:35:13 PDT 2012
Author: glider
Date: Mon Sep 10 03:35:12 2012
New Revision: 163493
URL: http://llvm.org/viewvc/llvm-project?rev=163493&view=rev
Log:
Allow to call strchr() from __asan_init().
Fixes PR13794.
Modified:
compiler-rt/trunk/lib/asan/asan_interceptors.cc
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=163493&r1=163492&r2=163493&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Mon Sep 10 03:35:12 2012
@@ -271,6 +271,11 @@
#if MAC_INTERPOSE_FUNCTIONS
if (!asan_inited) return REAL(strchr)(str, c);
#endif
+ // strchr is called inside create_purgeable_zone() when MallocGuardEdges=1 is
+ // used.
+ if (asan_init_is_running) {
+ return REAL(strchr)(str, c);
+ }
ENSURE_ASAN_INITED();
char *result = REAL(strchr)(str, c);
if (flags()->replace_str) {
More information about the llvm-commits
mailing list