summaryrefslogtreecommitdiff
path: root/lib/msan/msan_linux.cc
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2015-04-10 15:02:19 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2015-04-10 15:02:19 +0000
commit126afbb7f9d9c06871f6f2c28e5640504d15dbba (patch)
tree1bfc6b0b4cedb1a0f88443b72b50791934d64cae /lib/msan/msan_linux.cc
parent6c73b0681a43fa1d94ac69d8f775f88c3f89f780 (diff)
Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portable
On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_linux.cc')
-rw-r--r--lib/msan/msan_linux.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
index 6c185165f..26ba82b77 100644
--- a/lib/msan/msan_linux.cc
+++ b/lib/msan/msan_linux.cc
@@ -56,7 +56,7 @@ static bool CheckMemoryRangeAvailability(uptr beg, uptr size) {
static bool ProtectMemoryRange(uptr beg, uptr size) {
if (size > 0) {
uptr end = beg + size - 1;
- if (!Mprotect(beg, size)) {
+ if (!MmapNoAccess(beg, size)) {
Printf("FATAL: Cannot protect memory range %p - %p.\n", beg, end);
return false;
}