[PATCH] D43470: [DWARF] Prevent crash when .debug_line line_range is zero

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 09:38:51 PST 2018


jhenderson added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFDebugLine.cpp:309
+
+  if (LineRange == 0) {
+    fprintf(stderr, "warning: parsing line table prologue at 0x%8.8" PRIx64
----------------
jhenderson wrote:
> aprantl wrote:
> > aprantl wrote:
> > > aprantl wrote:
> > > > Can you also make it so that llvm-dwarfdump --verify reports this as an error?
> > > Nevermind. That's what you did!
> > Can you use DWARFVerifier::warn() here?
> > 
> I'll take a look for this and the other usages here.
> 
> llvm-dwarfdump --verify reports an error automatically if false is returned here, so that's how we get an error, as demonstrated in the test.
> Can you use DWARFVerifier::warn() here?
Just quickly looking at this before I leave the office. This function is currently private, and relies on an instance of DWARFVerifier, which I don't think is available. Do you mean to make it do the same thing as what DWARFVerifier::warn() does?



Repository:
  rL LLVM

https://reviews.llvm.org/D43470





More information about the llvm-commits mailing list