From e50874621a86893eb5b267cca89203e9052093cd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 16 Jul 2020 19:27:03 +0200 Subject: UserspaceEmulator: Don't scan text segment for malloc leaks There will be no (true positive) malloc addresses in the text segment. --- DevTools/UserspaceEmulator/MallocTracer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'DevTools/UserspaceEmulator/MallocTracer.cpp') diff --git a/DevTools/UserspaceEmulator/MallocTracer.cpp b/DevTools/UserspaceEmulator/MallocTracer.cpp index 36bad55a19..72c183d99a 100644 --- a/DevTools/UserspaceEmulator/MallocTracer.cpp +++ b/DevTools/UserspaceEmulator/MallocTracer.cpp @@ -163,6 +163,8 @@ bool MallocTracer::is_reachable(const Mallocation& mallocation) const // Skip the stack if (region.is_stack()) return IterationDecision::Continue; + if (region.is_text()) + return IterationDecision::Continue; // Skip malloc blocks if (region.is_mmap() && static_cast(region).is_malloc_block()) return IterationDecision::Continue; -- cgit v1.2.3