1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibELF: Remove sketchy use of "undefined" ELF::Image::Section

We were using ELF::Image::section(0) to indicate the "undefined"
section, when what we really wanted was just Optional<Section>.

So let's use Optional instead. :^)
This commit is contained in:
Andreas Kling 2021-05-15 00:13:44 +02:00
parent f70d0f03de
commit 16221305ad
6 changed files with 18 additions and 19 deletions

View file

@ -79,10 +79,10 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
void DebugInfo::prepare_lines()
{
auto section = elf().lookup_section(".debug_line");
if (section.is_undefined())
if (!section.has_value())
return;
InputMemoryStream stream { section.bytes() };
InputMemoryStream stream { section->bytes() };
Vector<Dwarf::LineProgram::LineInfo> all_lines;
while (!stream.eof()) {