[DebugInfo] UnwindTable::create() should not add empty rows to CFI unwind table
authorRamNalamothu <VenkataRamanaiah.Nalamothu@amd.com>
Sat, 8 May 2021 04:45:49 +0000 (10:15 +0530)
committerRamNalamothu <VenkataRamanaiah.Nalamothu@amd.com>
Sat, 8 May 2021 04:49:02 +0000 (10:19 +0530)
commit223852d76fccc85cc5a844feec94781e8c5320ff
treee49a3f972568a96ac47a6df02137a1ed90452f63
parent53b946aa636a31e9243b8c5bf1703a1f6eae798e
[DebugInfo] UnwindTable::create() should not add empty rows to CFI unwind table

UnwindTable::parseRows() may return successfully if the CFIProgram has either
no CFI instructions or only DW_CFA_nop instructions and the UnwindRow return
argument will be empty. But currently, the callers are not checking for this case
which is leading to incorrect dumps in the unwind tables in such cases i.e.

  CFA=unspecified

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D101892
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/unittests/DebugInfo/DWARF/DWARFDebugFrameTest.cpp