diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-16 20:55:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-16 20:55:41 +0200 |
commit | 27aa2e5841d5b617b1e81fc6a8b9cec897295289 (patch) | |
tree | b09ac406d3f630a725946f928bd1b67905db85c5 /DevTools/UserspaceEmulator/MallocTracer.cpp | |
parent | 5f0d24cab2fa18408b63a0e116e2e349710b1c73 (diff) | |
download | serenity-27aa2e5841d5b617b1e81fc6a8b9cec897295289.zip |
UserspaceEmulator: Reset malloc backtrace on mallocation reuse
If a previously-freed malloc chunk is reused, forget any old backtraces
and save a new malloc backtrace.
Diffstat (limited to 'DevTools/UserspaceEmulator/MallocTracer.cpp')
-rw-r--r-- | DevTools/UserspaceEmulator/MallocTracer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/DevTools/UserspaceEmulator/MallocTracer.cpp b/DevTools/UserspaceEmulator/MallocTracer.cpp index 72c183d99a..6d5ffdbcc7 100644 --- a/DevTools/UserspaceEmulator/MallocTracer.cpp +++ b/DevTools/UserspaceEmulator/MallocTracer.cpp @@ -45,6 +45,8 @@ void MallocTracer::target_did_malloc(Badge<SoftCPU>, FlatPtr address, size_t siz ASSERT(existing_mallocation->freed); existing_mallocation->size = size; existing_mallocation->freed = false; + existing_mallocation->malloc_backtrace = Emulator::the().raw_backtrace(); + existing_mallocation->free_backtrace.clear(); return; } m_mallocations.append({ address, size, false, Emulator::the().raw_backtrace(), Vector<FlatPtr>() }); |