[DebugInfo] Add check for .debug_line minimum_instruction_length of 0
authorJames Henderson <james.henderson@sony.com>
Tue, 25 Feb 2020 16:07:16 +0000 (16:07 +0000)
committerJames Henderson <james.henderson@sony.com>
Mon, 9 Mar 2020 12:59:44 +0000 (12:59 +0000)
commit684d6fdee208a1fa12e9cbe0a45f3c5b4b575ad7
tree81d53ed1eee585c031d4d498e72daf4e177b3a4b
parent6e0c9e46967e1dc701a8be66c5fd250c78d9a73e
[DebugInfo] Add check for .debug_line minimum_instruction_length of 0

If the minimum_instruction_length of a debug line program is 0, no
address advancing via special opcodes, DW_LNS_const_add_pc, and
DW_LNS_advance_pc can occur, since the minimum_instruction_length is
used in a multiplication. This patch adds a warning reporting when this
issue occurs.

Reviewed by: probinson

Differential Revision: https://reviews.llvm.org/D75189
llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp