[PATCH] D77555: [DWARFDebugLine] Check for errors when parsing v2 file/dir lists

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 08:06:22 PDT 2020


labath created this revision.
labath added reviewers: dblaikie, probinson, jhenderson.
Herald added subscribers: MaskRay, hiraditya.
Herald added a project: LLVM.
labath added a child revision: D77557: [DWARFDebugLine] Use truncating data extractors for prologue parsing.

Without this we could silently accept an invalid prologue because the
default DataExtractor behavior is to return an empty string when
reaching the end of file. And empty string is also used to terminate
these lists.

This makes the parsing code slightly more complicated, but this
complexity will go away once the parser starts working with truncating
data extractors. The reason I am doing it this way is because without
this, the truncation would regress the quality of error messages (right
now, we produce bad error messages only near EOF, but truncation would
make everything behave as if it was near EOF).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77555

Files:
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
  llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77555.255344.patch
Type: text/x-patch
Size: 9126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/9ad2b150/attachment-0001.bin>


More information about the llvm-commits mailing list