From 3cd9b54748fd042ae510388c0b711e478a957b00 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Jul 2018 13:40:08 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337550 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/esan/esan.cpp | 6 +++--- 1 file 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"); -- cgit v1.2.3