diff --git a/compiler-rt/lib/asan/asan_fuchsia.cpp b/compiler-rt/lib/asan/asan_fuchsia.cpp --- a/compiler-rt/lib/asan/asan_fuchsia.cpp +++ b/compiler-rt/lib/asan/asan_fuchsia.cpp @@ -196,6 +196,10 @@ return false; } +void FlushUnneededASanShadowMemory(uptr p, uptr size) { + __sanitizer_fill_shadow(p, size, 0, 0); +} + } // namespace __asan // These are declared (in extern "C") by . diff --git a/compiler-rt/lib/asan/asan_poisoning.cpp b/compiler-rt/lib/asan/asan_poisoning.cpp --- a/compiler-rt/lib/asan/asan_poisoning.cpp +++ b/compiler-rt/lib/asan/asan_poisoning.cpp @@ -62,17 +62,13 @@ } }; +#if !SANITIZER_FUCHSIA void FlushUnneededASanShadowMemory(uptr p, uptr size) { // Since asan's mapping is compacting, the shadow chunk may be // not page-aligned, so we only flush the page-aligned portion. ReleaseMemoryPagesToOS(MemToShadow(p), MemToShadow(p + size)); - -#if SANITIZER_FUCHSIA - // In Fuchsia ReleaseMemoryPagesToOS is a no-op. __sanitizer_fill_shadow - // With a 0 value and a 0 threshold will decommit the shadow pages. - __sanitizer_fill_shadow(p, size, 0, 0); -#endif } +#endif // !SANITIZER_FUCHSIA void AsanPoisonOrUnpoisonIntraObjectRedzone(uptr ptr, uptr size, bool poison) { uptr end = ptr + size;