[PATCH] D82886: [DebugInfo] Fix a possible crash when reading a malformed .debug_*lists section.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 18:19:52 PDT 2020


dblaikie added a comment.

In D82886#2127149 <https://reviews.llvm.org/D82886#2127149>, @ikudrin wrote:

> In D82886#2126027 <https://reviews.llvm.org/D82886#2126027>, @dblaikie wrote:
>
> > Is this assertion really valuable? "length()" does the same addition that is done to create the value that length() is being compared to - it's pretty trivial? Perhaps "FullLength" should be initialized with a call to length instead of duplicating that addition?
>
>
> In that case, we have a small inconsistency in the error message. In most cases, we report the full length of the data, which is the value of the unit length field plus the size of the field itself, but for the unit length of 0, we would not add the size of the field and would report only the raw value. This inconsistency is the only reason we calculate `FullLength` directly.


Is that difference necessary? I tried removing the length == 0 special case from "length()" and no tests fail. Perhaps we could go that route instead?


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

https://reviews.llvm.org/D82886





More information about the llvm-commits mailing list