diff options
-rw-r--r-- | lib/asan/asan_interceptors.h | 16 | ||||
-rw-r--r-- | lib/asan/asan_malloc_linux.cc | 2 | ||||
-rw-r--r-- | lib/asan/asan_stack.h | 10 | ||||
-rw-r--r-- | lib/interception/interception.h | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/lib/asan/asan_interceptors.h b/lib/asan/asan_interceptors.h index 8ebc4175d..32816920f 100644 --- a/lib/asan/asan_interceptors.h +++ b/lib/asan/asan_interceptors.h @@ -17,16 +17,16 @@ #include "asan_internal.h" #include "interception/interception.h" -DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size); -DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size); -DECLARE_REAL(void*, memset, void *block, int c, uptr size); -DECLARE_REAL(char*, strchr, const char *str, int c); -DECLARE_REAL(uptr, strlen, const char *s); -DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size); -DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen); +DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size) +DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size) +DECLARE_REAL(void*, memset, void *block, int c, uptr size) +DECLARE_REAL(char*, strchr, const char *str, int c) +DECLARE_REAL(uptr, strlen, const char *s) +DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size) +DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen) struct sigaction; DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act, - struct sigaction *oldact); + struct sigaction *oldact) namespace __asan { diff --git a/lib/asan/asan_malloc_linux.cc b/lib/asan/asan_malloc_linux.cc index ac1c84021..6c5682b1b 100644 --- a/lib/asan/asan_malloc_linux.cc +++ b/lib/asan/asan_malloc_linux.cc @@ -103,7 +103,7 @@ INTERCEPTOR(size_t, malloc_usable_size, void *ptr) { return asan_malloc_usable_size(ptr, &stack); } -INTERCEPTOR(struct mallinfo, mallinfo) { +INTERCEPTOR(struct mallinfo, mallinfo, void) { struct mallinfo res; REAL(memset)(&res, 0, sizeof(res)); return res; diff --git a/lib/asan/asan_stack.h b/lib/asan/asan_stack.h index 101408a81..35a6af2dd 100644 --- a/lib/asan/asan_stack.h +++ b/lib/asan/asan_stack.h @@ -63,7 +63,7 @@ struct AsanStackTrace { uptr bp = GET_CURRENT_FRAME(); \ uptr pc = GET_CALLER_PC(); \ uptr local_stack; \ - uptr sp = (uptr)&local_stack; + uptr sp = (uptr)&local_stack // Use this macro if you want to print stack trace with the current // function in the top frame. @@ -71,7 +71,7 @@ struct AsanStackTrace { uptr bp = GET_CURRENT_FRAME(); \ uptr pc = AsanStackTrace::GetCurrentPc(); \ uptr local_stack; \ - uptr sp = (uptr)&local_stack; + uptr sp = (uptr)&local_stack // Get the stack trace with the given pc and bp. // The pc will be in the position 0 of the resulting stack trace. @@ -79,7 +79,7 @@ struct AsanStackTrace { // fast_unwind is currently unused. #define GET_STACK_TRACE_WITH_PC_AND_BP(max_s, pc, bp) \ AsanStackTrace stack; \ - stack.GetStackTrace(max_s, pc, bp); \ + stack.GetStackTrace(max_s, pc, bp) // NOTE: A Rule of thumb is to retrieve stack trace in the interceptors // as early as possible (in functions exposed to the user), as we generally @@ -87,7 +87,7 @@ struct AsanStackTrace { #define GET_STACK_TRACE_HERE(max_size) \ GET_STACK_TRACE_WITH_PC_AND_BP(max_size, \ - AsanStackTrace::GetCurrentPc(), GET_CURRENT_FRAME()) \ + AsanStackTrace::GetCurrentPc(), GET_CURRENT_FRAME()) #define GET_STACK_TRACE_HERE_FOR_MALLOC \ GET_STACK_TRACE_HERE(FLAG_malloc_context_size) @@ -99,6 +99,6 @@ struct AsanStackTrace { { \ GET_STACK_TRACE_HERE(kStackTraceMax); \ stack.PrintStack(); \ - } \ + } #endif // ASAN_STACK_H diff --git a/lib/interception/interception.h b/lib/interception/interception.h index d3e807ae8..ab4c9edd5 100644 --- a/lib/interception/interception.h +++ b/lib/interception/interception.h @@ -105,20 +105,20 @@ #define REAL(x) __interception::PTR_TO_REAL(x) #define FUNC_TYPE(x) x##_f -#define DECLARE_REAL(ret_type, func, ...); \ +#define DECLARE_REAL(ret_type, func, ...) \ typedef ret_type (*FUNC_TYPE(func))(__VA_ARGS__); \ namespace __interception { \ extern FUNC_TYPE(func) PTR_TO_REAL(func); \ } -#define DECLARE_REAL_AND_INTERCEPTOR(ret_type, func, ...); \ +#define DECLARE_REAL_AND_INTERCEPTOR(ret_type, func, ...) \ DECLARE_REAL(ret_type, func, ##__VA_ARGS__); \ extern "C" ret_type WRAP(func)(__VA_ARGS__); // FIXME(timurrrr): We might need to add DECLARE_REAL_EX etc to support // different calling conventions later. -#define DEFINE_REAL_EX(ret_type, convention, func, ...); \ +#define DEFINE_REAL_EX(ret_type, convention, func, ...) \ typedef ret_type (convention *FUNC_TYPE(func))(__VA_ARGS__); \ namespace __interception { \ FUNC_TYPE(func) PTR_TO_REAL(func); \ @@ -130,11 +130,11 @@ // foo with an interceptor for other function. #define DEFAULT_CONVENTION -#define DEFINE_REAL(ret_type, func, ...); \ +#define DEFINE_REAL(ret_type, func, ...) \ DEFINE_REAL_EX(ret_type, DEFAULT_CONVENTION, func, __VA_ARGS__); #define INTERCEPTOR_EX(ret_type, convention, func, ...) \ - DEFINE_REAL_EX(ret_type, convention, func, __VA_ARGS__); \ + DEFINE_REAL_EX(ret_type, convention, func, __VA_ARGS__) \ DECLARE_WRAPPER(ret_type, convention, func, __VA_ARGS__); \ extern "C" \ INTERCEPTOR_ATTRIBUTE \ |