[PATCH] D44205: [ELF] Prevent crash when reporting error messages if debug line cannot be parsed

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 06:15:10 PST 2018


grimar 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;
----------------
If there any reason why it cannot be early returned above?

```
  const DWARFDebugLine::LineTable *LT =
      DwarfLine->getOrParseLineTable(LineData, 0, Dwarf, nullptr);
  if (!LT)
    return;
```


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44205





More information about the llvm-commits mailing list