summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 09b530b66..44b8032ca 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");