[DebugInfo/DWARF] - Do not hang when CFI are truncated.
authorGeorgii Rymar <grimar@accesssoftek.com>
Wed, 17 Jun 2020 14:42:55 +0000 (17:42 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Tue, 23 Jun 2020 11:39:24 +0000 (14:39 +0300)
commit1e820e82b1438a52124512175a0e7c6f8d23e158
tree661faf60b6353774e69cf6b1fa61f682be0ee248
parent01fee8dce549a7c3787655c48a35ce22168d87e2
[DebugInfo/DWARF] - Do not hang when CFI are truncated.

Currently when the .eh_frame section is truncated so that
CFI instructions can't be read, it is possible to enter
an infinite loop.

It happens because `CFIProgram::parse` does not handle errors properly.
This patch fixes the issue.

Differential revision: https://reviews.llvm.org/D82017
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp