[llvm-commits] [compiler-rt] r173049 - /compiler-rt/trunk/lib/asan/tests/asan_test.cc
Kostya Serebryany
kcc at google.com
Mon Jan 21 07:04:36 PST 2013
Author: kcc
Date: Mon Jan 21 09:04:36 2013
New Revision: 173049
URL: http://llvm.org/viewvc/llvm-project?rev=173049&view=rev
Log:
[asan] fix linux build
Modified:
compiler-rt/trunk/lib/asan/tests/asan_test.cc
Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=173049&r1=173048&r2=173049&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Mon Jan 21 09:04:36 2013
@@ -1093,6 +1093,15 @@
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 @@
}
#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);
More information about the llvm-commits
mailing list