[DebugInfo] Check for errors when reading data for extended opcode
authorJames Henderson <james.henderson@sony.com>
Thu, 21 May 2020 14:14:16 +0000 (15:14 +0100)
committerJames Henderson <james.henderson@sony.com>
Tue, 9 Jun 2020 08:56:37 +0000 (09:56 +0100)
commit5777570d24027fe23bbb5ab32d8481c360b983d7
treebf6bbc4595eb263a5fed333001cc01a34fc30f28
parente26ed6bdaec4460bbcb8761e7c1105cdc7a55c83
[DebugInfo] Check for errors when reading data for extended opcode

Previously, if an extended opcode was truncated, it would manifest as an
"unexpected line op length error" which wasn't quite accurate. This
change checks for errors any time data is read whilst parsing an
extended opcode, and reports any errors detected.

Reviewed by: MaskRay, labath, aprantl

Differential Revision: https://reviews.llvm.org/D80797
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp