[PATCH] D77308: [DWARF] Detect extraction errors in DWARFFormValue::extractValue

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 08:06:23 PDT 2020


labath created this revision.
labath added reviewers: dblaikie, aprantl.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
labath added parent revisions: D77304: [llvm/Support] Don't crash on empty nullptr ranges when decoding LEBs, D77307: [Support] Make DataExtractor string functions error-aware, D77306: [llvm/Support] Make more DataExtractor methods error-aware.

Although the function had a bool return value, it was always returning
true. Presumably this is because the main type of errors one can
encounter here is running off the end of the stream, and until very
recently, the DataExtractor class made it very difficult to detect that.

The situation has changed now, and we can easily detect errors here,
which this patch does.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77308

Files:
  llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
  llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77308.254523.patch
Type: text/x-patch
Size: 7190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/5d0fa9e9/attachment.bin>


More information about the llvm-commits mailing list