From 031b69d8dfb974798bafe8a1b123bfe0e7a7991a Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Mon, 21 Jan 2013 15:04:36 +0000 Subject: [PATCH] [asan] fix linux build llvm-svn: 173049 --- compiler-rt/lib/asan/tests/asan_test.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler-rt/lib/asan/tests/asan_test.cc b/compiler-rt/lib/asan/tests/asan_test.cc index 6d1ac53..825991d 100644 --- a/compiler-rt/lib/asan/tests/asan_test.cc +++ b/compiler-rt/lib/asan/tests/asan_test.cc @@ -1093,6 +1093,15 @@ TEST(AddressSanitizer, StrLenOOBTest) { free(heap_string); } +static inline char* MallocAndMemsetString(size_t size, char ch) { + char *s = Ident((char*)malloc(size)); + memset(s, ch, size); + return s; +} +static inline char* MallocAndMemsetString(size_t size) { + return MallocAndMemsetString(size, 'z'); +} + #ifndef __APPLE__ TEST(AddressSanitizer, StrNLenOOBTest) { size_t size = Ident(123); @@ -1113,15 +1122,6 @@ TEST(AddressSanitizer, StrNLenOOBTest) { } #endif -static inline char* MallocAndMemsetString(size_t size, char ch) { - char *s = Ident((char*)malloc(size)); - memset(s, ch, size); - return s; -} -static inline char* MallocAndMemsetString(size_t size) { - return MallocAndMemsetString(size, 'z'); -} - TEST(AddressSanitizer, StrDupOOBTest) { size_t size = Ident(42); char *str = MallocAndMemsetString(size); -- 2.7.4