[compiler-rt] r267203 - [sanitizer] allow zero first parameter in MmapNoAccess; This is a part of r267094 that has been reverted
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 13:05:53 PDT 2016
Author: kcc
Date: Fri Apr 22 15:05:52 2016
New Revision: 267203
URL: http://llvm.org/viewvc/llvm-project?rev=267203&view=rev
Log:
[sanitizer] allow zero first parameter in MmapNoAccess; This is a part of r267094 that has been reverted
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc?rev=267203&r1=267202&r2=267203&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc Fri Apr 22 15:05:52 2016
@@ -272,7 +272,8 @@ void *MmapFixedNoReserve(uptr fixed_addr
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,
More information about the llvm-commits
mailing list