[PATCH] D76498: [DWARF] Fix v5 debug_line parsing of prologues with many files

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 03:15:44 PDT 2020


labath added a comment.

In D76498#1936245 <https://reviews.llvm.org/D76498#1936245>, @jhenderson wrote:

> In D76498#1933793 <https://reviews.llvm.org/D76498#1933793>, @probinson wrote:
>
> > I suppose this should lead to questions about whether mis-encoded ULEBs can cause parsing sadness, and are those handled in a reasonable way?
>
>
> If I'm not mistaken, the only way a ULEB could be misencoded can be detected is by it running off the end of the data (although in practice a value greater than max uint64_t will also be detected IIRC). I have a vague memory that the data extractor records an error, if using the appropriate style of parsing, but I don't think we are currently using that type in some cases, so the error is ignored.


Yeah, there isn't enough (or any) redundancy in ULEBs to detect an invalid value. These kinds of errors will manifest themselves as random failures further down the line when the parser gets out of sync with the data.

I have looked at changing this function to the Error-aware overloads (I'm currently prototyping the truncating data extractor -- that's how I found this patch), but it gets tricky since some of the parsing is delegated to DWARFFormValue, which is also not error-aware.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76498/new/

https://reviews.llvm.org/D76498





More information about the llvm-commits mailing list