[sanitizer] allow zero first parameter in MmapNoAccess; This is a part of r267094 that has been reverted

llvm-svn: 267203
This commit is contained in:
Kostya Serebryany 2016-04-22 20:05:52 +00:00
parent e7809c3a28
commit d4f275cecb
1 changed files with 2 additions and 1 deletions

View File

@ -272,7 +272,8 @@ void *MmapFixedNoReserve(uptr fixed_addr, uptr size, const char *name) {
void *MmapNoAccess(uptr fixed_addr, uptr size, const char *name) {
int fd = name ? GetNamedMappingFd(name, size) : -1;
unsigned flags = MAP_PRIVATE | MAP_FIXED | MAP_NORESERVE;
unsigned flags = MAP_PRIVATE | MAP_NORESERVE;
if (fixed_addr != 0) flags |= MAP_FIXED;
if (fd == -1) flags |= MAP_ANON;
return (void *)internal_mmap((void *)fixed_addr, size, PROT_NONE, flags, fd,