mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibDebug: Store LibDebug objects on the heap & make them non-copyable
This fixes an issue were some LibDebug objects (for example, Dwarf::CompilationUnit) held a reference to their parent Dwarf::DwarfInfo object, which was constructed on the stack and later moved to the heap.
This commit is contained in:
parent
edd79ddd00
commit
e9e4358a93
7 changed files with 19 additions and 10 deletions
|
@ -44,7 +44,7 @@ void DwarfInfo::populate_compilation_units()
|
|||
VERIFY(compilation_unit_header.address_size() == sizeof(u32));
|
||||
|
||||
u32 length_after_header = compilation_unit_header.length() - (compilation_unit_header.header_size() - offsetof(CompilationUnitHeader, common.version));
|
||||
m_compilation_units.empend(*this, unit_offset, compilation_unit_header);
|
||||
m_compilation_units.append(make<CompilationUnit>(*this, unit_offset, compilation_unit_header));
|
||||
stream.discard_or_error(length_after_header);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue