mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:17:35 +00:00
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.
This commit is contained in:
parent
5f0d24cab2
commit
27aa2e5841
1 changed files with 2 additions and 0 deletions
|
@ -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>() });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue