We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d11a91 + f8f0848 commit 9a55002Copy full SHA for 9a55002
compiler-rt/test/dfsan/interceptors.c renamed to compiler-rt/test/dfsan/mmap_at_init.c
@@ -6,9 +6,7 @@
6
//
7
// Tests that calling mmap() during during dfsan initialization works.
8
9
-#include <assert.h>
10
#include <sanitizer/dfsan_interface.h>
11
-#include <string.h>
12
#include <sys/mman.h>
13
#include <unistd.h>
14
@@ -23,7 +21,9 @@ void *calloc(size_t Num, size_t Size) {
23
21
Size = (Size + PageSize - 1) & ~(PageSize - 1); // Round up to PageSize.
24
22
void *Ret = mmap(NULL, Size, PROT_READ | PROT_WRITE,
25
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
26
- assert(Ret != MAP_FAILED);
+ // Use assert may cause link errors that require -Wl,-z,notext.
+ // Do not know the root cause yet.
+ if (Ret == MAP_FAILED) exit(-1);
27
return Ret;
28
}
29
0 commit comments