[compiler-rt] r355230 - Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 13:49:40 PST 2019
Author: eugenis
Date: Fri Mar 1 13:49:40 2019
New Revision: 355230
URL: http://llvm.org/viewvc/llvm-project?rev=355230&view=rev
Log:
Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."
This change is incomplete.
Modified:
compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.cc
compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.h
compiler-rt/trunk/lib/msan/msan_interceptors.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
Modified: compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.cc?rev=355230&r1=355229&r2=355230&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.cc Fri Mar 1 13:49:40 2019
@@ -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
Modified: compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.h?rev=355230&r1=355229&r2=355230&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors_memintrinsics.h Fri Mar 1 13:49:40 2019
@@ -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) \
Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=355230&r1=355229&r2=355230&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Fri Mar 1 13:49:40 2019
@@ -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) \
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=355230&r1=355229&r2=355230&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Fri Mar 1 13:49:40 2019
@@ -771,7 +771,6 @@ INTERCEPTOR(char *, strpbrk, const char
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, i
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, c
} else {
COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);
}
- return dst;
}
#define INIT_MEMCPY \
@@ -5449,63 +5446,63 @@ INTERCEPTOR(int, capset, void *hdrp, con
#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
#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);
}
More information about the llvm-commits
mailing list