summaryrefslogtreecommitdiff
path: root/DevTools/UserspaceEmulator/MallocTracer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-16 19:27:03 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-16 19:27:03 +0200
commite50874621a86893eb5b267cca89203e9052093cd (patch)
tree29ea60ceb2be8020fa2b98cdc80110d835134654 /DevTools/UserspaceEmulator/MallocTracer.cpp
parent3dc1c809581cba246fe29afda5e2739e2c887b17 (diff)
downloadserenity-e50874621a86893eb5b267cca89203e9052093cd.zip
UserspaceEmulator: Don't scan text segment for malloc leaks
There will be no (true positive) malloc addresses in the text segment.
Diffstat (limited to 'DevTools/UserspaceEmulator/MallocTracer.cpp')
-rw-r--r--DevTools/UserspaceEmulator/MallocTracer.cpp2
1 files changed, 2 insertions, 0 deletions
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<const MmapRegion&>(region).is_malloc_block())
return IterationDecision::Continue;