From b4b05017cf2de15fd34d7734d221d5e9d8321cfd Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Mon, 12 Jan 2015 20:18:38 +0000 Subject: [PATCH] [Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD Differential Revision: http://reviews.llvm.org/D6929 llvm-svn: 225688 --- compiler-rt/lib/msan/tests/msan_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/msan/tests/msan_test.cc b/compiler-rt/lib/msan/tests/msan_test.cc index 1a2adbc..edad8e2 100644 --- a/compiler-rt/lib/msan/tests/msan_test.cc +++ b/compiler-rt/lib/msan/tests/msan_test.cc @@ -1167,7 +1167,7 @@ TEST(MemorySanitizer, shmctl) { TEST(MemorySanitizer, shmat) { void *p = mmap(NULL, 4096, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT_NE(MAP_FAILED, p); ((char *)p)[10] = *GetPoisoned(); @@ -4126,7 +4126,8 @@ TEST(MemorySanitizer, LargeAllocatorUnpoisonsOnFree) { // Allocate the page that was released to the OS in free() with the real mmap, // bypassing the interceptor. - char *q = (char *)real_mmap(p, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); + char *q = (char *)real_mmap(p, 4096, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); ASSERT_NE((char *)0, q); ASSERT_TRUE(q <= p); -- 2.7.4