[PATCH] Add FreeBSD support to Asan test cases that use mmap() with MAP_ANON
Viktor Kutuzov
vkutuzov at accesssoftek.com
Fri Jul 18 05:00:38 PDT 2014
Updated.
http://reviews.llvm.org/D4561
Files:
test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
test/asan/TestCases/dlclose-test.cc
Index: test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
===================================================================
--- test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
+++ test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
@@ -27,7 +27,8 @@
void *p = my_memalign(kPageSize, 1024 * 1024);
free(p);
- char *q = (char *)mmap(p, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, 0, 0);
+ char *q = (char *)mmap(p, kPageSize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
assert(q == p);
memset(q, 42, kPageSize);
Index: test/asan/TestCases/dlclose-test.cc
===================================================================
--- test/asan/TestCases/dlclose-test.cc
+++ test/asan/TestCases/dlclose-test.cc
@@ -66,7 +66,7 @@
size_t page_beg = ((size_t)addr) & ~(PageSize - 1);
void *res = mmap((void*)(page_beg), PageSize,
PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_NORESERVE, 0, 0);
+ MAP_PRIVATE | MAP_ANON | MAP_FIXED | MAP_NORESERVE, -1, 0);
if (res == (char*)-1L) {
printf("failed to mmap\n");
return 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4561.11636.patch
Type: text/x-patch
Size: 1237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/a4978b99/attachment.bin>
More information about the llvm-commits
mailing list