mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
Notes:
sideshowbarker
2024-07-18 12:01:46 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/e9e4358a935 Pull-request: https://github.com/SerenityOS/serenity/pull/8149 Reviewed-by: https://github.com/gunnarbeutner
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user