Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."
This change is incomplete. llvm-svn: 355230
This commit is contained in:
parent
a908829bf5
commit
72e83488f3
|
@ -20,17 +20,14 @@ using namespace __asan; // NOLINT
|
|||
|
||||
void *__asan_memcpy(void *to, const void *from, uptr size) {
|
||||
ASAN_MEMCPY_IMPL(nullptr, to, from, size);
|
||||
return to;
|
||||
}
|
||||
|
||||
void *__asan_memset(void *block, int c, uptr size) {
|
||||
ASAN_MEMSET_IMPL(nullptr, block, c, size);
|
||||
return block;
|
||||
}
|
||||
|
||||
void *__asan_memmove(void *to, const void *from, uptr size) {
|
||||
ASAN_MEMMOVE_IMPL(nullptr, to, from, size);
|
||||
return to;
|
||||
}
|
||||
|
||||
#if SANITIZER_FUCHSIA || SANITIZER_RTEMS
|
||||
|
|
|
@ -82,8 +82,7 @@ struct AsanInterceptorContext {
|
|||
do { \
|
||||
if (UNLIKELY(!asan_inited)) return internal_memcpy(to, from, size); \
|
||||
if (asan_init_is_running) { \
|
||||
REAL(memcpy)(to, from, size); \
|
||||
break; \
|
||||
return REAL(memcpy)(to, from, size); \
|
||||
} \
|
||||
ENSURE_ASAN_INITED(); \
|
||||
if (flags()->replace_intrin) { \
|
||||
|
@ -93,7 +92,7 @@ struct AsanInterceptorContext {
|
|||
ASAN_READ_RANGE(ctx, from, size); \
|
||||
ASAN_WRITE_RANGE(ctx, to, size); \
|
||||
} \
|
||||
REAL(memcpy)(to, from, size); \
|
||||
return REAL(memcpy)(to, from, size); \
|
||||
} while (0)
|
||||
|
||||
// memset is called inside Printf.
|
||||
|
@ -101,14 +100,13 @@ struct AsanInterceptorContext {
|
|||
do { \
|
||||
if (UNLIKELY(!asan_inited)) return internal_memset(block, c, size); \
|
||||
if (asan_init_is_running) { \
|
||||
REAL(memset)(block, c, size); \
|
||||
break; \
|
||||
return REAL(memset)(block, c, size); \
|
||||
} \
|
||||
ENSURE_ASAN_INITED(); \
|
||||
if (flags()->replace_intrin) { \
|
||||
ASAN_WRITE_RANGE(ctx, block, size); \
|
||||
} \
|
||||
REAL(memset)(block, c, size); \
|
||||
return REAL(memset)(block, c, size); \
|
||||
} while (0)
|
||||
|
||||
#define ASAN_MEMMOVE_IMPL(ctx, to, from, size) \
|
||||
|
@ -119,7 +117,7 @@ struct AsanInterceptorContext {
|
|||
ASAN_READ_RANGE(ctx, from, size); \
|
||||
ASAN_WRITE_RANGE(ctx, to, size); \
|
||||
} \
|
||||
internal_memmove(to, from, size); \
|
||||
return internal_memmove(to, from, size); \
|
||||
} while (0)
|
||||
|
||||
#define ASAN_READ_RANGE(ctx, offset, size) \
|
||||
|
|
|
@ -1311,17 +1311,17 @@ int OnExit() {
|
|||
#define COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size) \
|
||||
{ \
|
||||
(void)ctx; \
|
||||
__msan_memset(block, c, size); \
|
||||
return __msan_memset(block, c, size); \
|
||||
}
|
||||
#define COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size) \
|
||||
{ \
|
||||
(void)ctx; \
|
||||
__msan_memmove(to, from, size); \
|
||||
return __msan_memmove(to, from, size); \
|
||||
}
|
||||
#define COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size) \
|
||||
{ \
|
||||
(void)ctx; \
|
||||
__msan_memcpy(to, from, size); \
|
||||
return __msan_memcpy(to, from, size); \
|
||||
}
|
||||
|
||||
#define COMMON_INTERCEPTOR_COPY_STRING(ctx, to, from, size) \
|
||||
|
|
|
@ -771,7 +771,6 @@ INTERCEPTOR(char *, strpbrk, const char *s1, const char *s2) {
|
|||
INTERCEPTOR(void *, memset, void *dst, int v, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, dst, v, size);
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define INIT_MEMSET COMMON_INTERCEPT_FUNCTION(memset)
|
||||
|
@ -783,7 +782,6 @@ INTERCEPTOR(void *, memset, void *dst, int v, uptr size) {
|
|||
INTERCEPTOR(void *, memmove, void *dst, const void *src, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define INIT_MEMMOVE COMMON_INTERCEPT_FUNCTION(memmove)
|
||||
|
@ -804,7 +802,6 @@ INTERCEPTOR(void *, memcpy, void *dst, const void *src, uptr size) {
|
|||
} else {
|
||||
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define INIT_MEMCPY \
|
||||
|
@ -5449,63 +5446,63 @@ INTERCEPTOR(int, capset, void *hdrp, const void *datap) {
|
|||
#endif
|
||||
|
||||
#if SANITIZER_INTERCEPT_AEABI_MEM
|
||||
INTERCEPTOR(void, __aeabi_memmove, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memmove, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memmove4, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memmove4, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memmove8, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memmove8, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memcpy, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memcpy, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memcpy4, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memcpy4, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memcpy8, void *to, const void *from, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memcpy8, void *to, const void *from, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size);
|
||||
}
|
||||
|
||||
// Note the argument order.
|
||||
INTERCEPTOR(void, __aeabi_memset, void *block, uptr size, int c) {
|
||||
INTERCEPTOR(void *, __aeabi_memset, void *block, uptr size, int c) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memset4, void *block, uptr size, int c) {
|
||||
INTERCEPTOR(void *, __aeabi_memset4, void *block, uptr size, int c) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memset8, void *block, uptr size, int c) {
|
||||
INTERCEPTOR(void *, __aeabi_memset8, void *block, uptr size, int c) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memclr, void *block, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memclr, void *block, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, 0, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memclr4, void *block, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memclr4, void *block, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, 0, size);
|
||||
}
|
||||
|
||||
INTERCEPTOR(void, __aeabi_memclr8, void *block, uptr size) {
|
||||
INTERCEPTOR(void *, __aeabi_memclr8, void *block, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, 0, size);
|
||||
}
|
||||
|
@ -5528,7 +5525,7 @@ INTERCEPTOR(void, __aeabi_memclr8, void *block, uptr size) {
|
|||
#endif // SANITIZER_INTERCEPT_AEABI_MEM
|
||||
|
||||
#if SANITIZER_INTERCEPT___BZERO
|
||||
INTERCEPTOR(void, __bzero, void *block, uptr size) {
|
||||
INTERCEPTOR(void *, __bzero, void *block, uptr size) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, 0, size);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue