[sanitizer] Fix Mac build.

llvm-svn: 172809
This commit is contained in:
Evgeniy Stepanov 2013-01-18 11:38:23 +00:00
parent f54319c891
commit 91181eaa59
3 changed files with 15 additions and 2 deletions

View File

@ -226,6 +226,17 @@ DECLARE_FUNCTION_AND_WRAPPER(void, __CFInitialize, void);
DECLARE_FUNCTION_AND_WRAPPER(CFStringRef, CFStringCreateCopy,
CFAllocatorRef alloc, CFStringRef str);
DECLARE_FUNCTION_AND_WRAPPER(void, free, void* ptr);
DECLARE_FUNCTION_AND_WRAPPER(int, vscanf, const char *format, va_list ap)
DECLARE_FUNCTION_AND_WRAPPER(int, vsscanf, const char *str, const char *format,
va_list ap)
DECLARE_FUNCTION_AND_WRAPPER(int, vfscanf, void *stream, const char *format,
va_list ap)
DECLARE_FUNCTION_AND_WRAPPER(int, scanf, const char *format, ...)
DECLARE_FUNCTION_AND_WRAPPER(int, fscanf, void* stream, const char *format, ...)
DECLARE_FUNCTION_AND_WRAPPER(int, sscanf,
const char *str, const char *format, ...)
#if MAC_INTERPOSE_FUNCTIONS && !defined(MISSING_BLOCKS_SUPPORT)
DECLARE_FUNCTION_AND_WRAPPER(void, dispatch_group_async,
dispatch_group_t dg,

View File

@ -88,7 +88,8 @@ using namespace __asan; // NOLINT
#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) ASAN_WRITE_RANGE(ptr, size)
#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) ASAN_READ_RANGE(ptr, size)
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) (void)ctx; ENSURE_ASAN_INITED()
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
do {ctx = 0; (void)ctx; ENSURE_ASAN_INITED();} while (false)
#define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) do { } while (false)
#define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) do { } while (false)
#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) SetThreadName(name)

View File

@ -738,7 +738,8 @@ INTERCEPTOR(int, getrusage, int who, void *usage) {
#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
__msan_unpoison(ptr, size)
#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) do { } while (false)
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) (void)ctx; ENSURE_MSAN_INITED()
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
do {ctx = 0; (void)ctx; ENSURE_MSAN_INITED();} while (false)
#define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) do { } while (false)
#define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) do { } while (false)
#define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) do { } while (false) // FIXME