From 97cf5f7f40fed23aa2d3bd2e67d58df74e466992 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Jul 2018 13:40:08 +0000 Subject: [PATCH] esan: fix shadow setup r337531 changed return type of MmapFixedNoReserve, but esan wasn't updated. As the result esan shadow setup always fails. We probably need to make MmapFixedNoAccess signature consistent with MmapFixedNoReserve. But this is just to unbreak tests. llvm-svn: 337550 --- compiler-rt/lib/esan/esan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler-rt/lib/esan/esan.cpp b/compiler-rt/lib/esan/esan.cpp index 09b530b6645f..44b8032caa1a 100644 --- a/compiler-rt/lib/esan/esan.cpp +++ b/compiler-rt/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");