2222
2323using namespace __asan ;
2424
25+ // AIX does not intercept memcpy, so we have to use internal_memcpy.
26+ #if !SANITIZER_AIX
27+ #define ASAN_MEMCPY_RETURN (to, from, size ) \
28+ return REAL(memcpy)(to, from, size)
29+ #else
30+ #define ASAN_MEMCPY_RETURN (to, from, size ) \
31+ return internal_memcpy(to, from, size)
32+ #endif
33+
2534// memcpy is called during __asan_init() from the internals of printf(...).
2635// We do not treat memcpy with to==from as a bug.
2736// See http://llvm.org/bugs/show_bug.cgi?id=11763.
28- // AIX does not intercept memcpy, so we have to use internal_memcpy.
2937#define ASAN_MEMCPY_IMPL (ctx, to, from, size ) \
3038 do { \
3139 if (LIKELY (replace_intrin_cached)) { \
@@ -36,12 +44,8 @@ using namespace __asan;
3644 ASAN_WRITE_RANGE (ctx, to, size); \
3745 } else if (UNLIKELY (!AsanInited ())) { \
3846 return internal_memcpy (to, from, size); \
39- }
40- #if !SANITIZER_AIX
41- return REAL (memcpy)(to, from, size);
42- #else
43- return internal_memcpy (to, from, size);
44- #endif
47+ } \
48+ ASAN_MEMCPY_RETURN (to, from, size); \
4549 } while (0 )
4650
4751// memset is called inside Printf.
0 commit comments