Skip to content

Commit 9a55002

Browse files
author
git apple-llvm automerger
committed
Merge commit 'f8f084816203' from apple/main into swift/next
2 parents 5d11a91 + f8f0848 commit 9a55002

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler-rt/test/dfsan/interceptors.c renamed to compiler-rt/test/dfsan/mmap_at_init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
//
77
// Tests that calling mmap() during during dfsan initialization works.
88

9-
#include <assert.h>
109
#include <sanitizer/dfsan_interface.h>
11-
#include <string.h>
1210
#include <sys/mman.h>
1311
#include <unistd.h>
1412

@@ -23,7 +21,9 @@ void *calloc(size_t Num, size_t Size) {
2321
Size = (Size + PageSize - 1) & ~(PageSize - 1); // Round up to PageSize.
2422
void *Ret = mmap(NULL, Size, PROT_READ | PROT_WRITE,
2523
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
26-
assert(Ret != MAP_FAILED);
24+
// Use assert may cause link errors that require -Wl,-z,notext.
25+
// Do not know the root cause yet.
26+
if (Ret == MAP_FAILED) exit(-1);
2727
return Ret;
2828
}
2929

0 commit comments

Comments
 (0)