Allow to call strchr() from __asan_init().
Fixes PR13794. llvm-svn: 163493
This commit is contained in:
parent
464a7f7e89
commit
67192d41ee
|
@ -271,6 +271,11 @@ INTERCEPTOR(char*, strchr, const char *str, int c) {
|
|||
#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) {
|
||||
|
|
Loading…
Reference in New Issue