diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2018-07-20 13:40:08 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2018-07-20 13:40:08 +0000 |
commit | 3cd9b54748fd042ae510388c0b711e478a957b00 (patch) | |
tree | 932b012c53f941eead171c6588f55811398b55e1 | |
parent | f3c53c57134e51a1db5d78478125aeda7d81fa20 (diff) | |
download | compiler-rt-3cd9b54748fd042ae510388c0b711e478a957b00.tar.gz |
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
-rw-r--r-- | lib/esan/esan.cpp | 6 |
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"); |