aboutsummaryrefslogtreecommitdiff
path: root/lib/esan/esan.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:48 +0000
commit93c1b73a09a52d4a265f683bf1954b08bb430049 (patch)
tree5543464d74945196cc890e9d9099e5d0660df7eb /lib/esan/esan.cpp
parent0d8e7490d6e8a13a8f0977d9b7771803b9f64ea0 (diff)
Diffstat (limited to 'lib/esan/esan.cpp')
-rw-r--r--lib/esan/esan.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/esan/esan.cpp b/lib/esan/esan.cpp
index 09b530b6645f..44b8032caa1a 100644
--- a/lib/esan/esan.cpp
+++ b/lib/esan/esan.cpp
@@ -163,15 +163,15 @@ static void initializeShadow() {
VPrintf(1, "Shadow #%d: [%zx-%zx) (%zuGB)\n", i, ShadowStart, ShadowEnd,
(ShadowEnd - ShadowStart) >> 30);
- uptr Map;
+ uptr Map = 0;
if (__esan_which_tool == ESAN_WorkingSet) {
// We want to identify all shadow pages that are touched so we start
// out inaccessible.
Map = (uptr)MmapFixedNoAccess(ShadowStart, ShadowEnd- ShadowStart,
"shadow");
} else {
- Map = (uptr)MmapFixedNoReserve(ShadowStart, ShadowEnd - ShadowStart,
- "shadow");
+ if (MmapFixedNoReserve(ShadowStart, ShadowEnd - ShadowStart, "shadow"))
+ Map = ShadowStart;
}
if (Map != ShadowStart) {
Printf("FATAL: EfficiencySanitizer failed to map its shadow memory.\n");