}
INTERCEPTOR(int, memcmp, const void *a1, const void *a2, uptr size) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(memcmp)(a1, a2, size);
-#endif
+ if (!asan_inited) return internal_memcmp(a1, a2, size);
ENSURE_ASAN_INITED();
unsigned char c1 = 0, c2 = 0;
const unsigned char *s1 = (const unsigned char*)a1;
}
INTERCEPTOR(void*, memcpy, void *to, const void *from, uptr size) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(memcpy)(to, from, size);
-#endif
+ if (!asan_inited) return internal_memcpy(to, from, size);
// memcpy is called during __asan_init() from the internals
// of printf(...).
if (asan_init_is_running) {
}
INTERCEPTOR(void*, memset, void *block, int c, uptr size) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(memset)(block, c, size);
-#endif
+ if (!asan_inited) return internal_memset(block, c, size);
// memset is called inside Printf.
if (asan_init_is_running) {
return REAL(memset)(block, c, size);
}
INTERCEPTOR(char*, strchr, const char *str, int c) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(strchr)(str, c);
-#endif
+ if (!asan_inited) return internal_strchr(str, c);
// strchr is called inside create_purgeable_zone() when MallocGuardEdges=1 is
// used.
if (asan_init_is_running) {
}
INTERCEPTOR(int, strcmp, const char *s1, const char *s2) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(strcmp)(s1, s2);
-#endif
+ if (!asan_inited) return internal_strcmp(s1, s2);
if (asan_init_is_running) {
return REAL(strcmp)(s1, s2);
}
#if ASAN_INTERCEPT_STRDUP
INTERCEPTOR(char*, strdup, const char *s) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(strdup)(s);
-#endif
+ if (!asan_inited) return internal_strdup(s);
ENSURE_ASAN_INITED();
if (flags()->replace_str) {
uptr length = REAL(strlen)(s);
#endif
INTERCEPTOR(uptr, strlen, const char *s) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(strlen)(s);
-#endif
+ if (!asan_inited) return internal_strlen(s);
// strlen is called from malloc_default_purgeable_zone()
// in __asan::ReplaceSystemAlloc() on Mac.
if (asan_init_is_running) {
#endif // ASAN_INTERCEPT_STRCASECMP_AND_STRNCASECMP
INTERCEPTOR(int, strncmp, const char *s1, const char *s2, uptr size) {
-#if MAC_INTERPOSE_FUNCTIONS
- if (!asan_inited) return REAL(strncmp)(s1, s2, size);
-#endif
+ if (!asan_inited) return internal_strncmp(s1, s2, size);
// strncmp is called from malloc_default_purgeable_zone()
// in __asan::ReplaceSystemAlloc() on Mac.
if (asan_init_is_running) {