[PATCH] D44205: [ELF] Prevent crash when reporting error messages if debug line cannot be parsed
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 7 06:16:50 PST 2018
jhenderson added inline comments.
================
Comment at: ELF/InputFiles.cpp:149
unsigned File = dwarf::toUnsigned(Die.find(dwarf::DW_AT_decl_file), 0);
- if (!LT->hasFileAtIndex(File))
+ if (!LT || !LT->hasFileAtIndex(File))
continue;
----------------
grimar wrote:
> If there any reason why it cannot be early returned above?
>
> ```
> const DWARFDebugLine::LineTable *LT =
> DwarfLine->getOrParseLineTable(LineData, 0, Dwarf, nullptr);
> if (!LT)
> return;
> ```
Good point - not that I can think of.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D44205
More information about the llvm-commits
mailing list