Fixed a bug where CFI data would become corrupted when using remember/restore state instructions.

This would prevent system calls on Linux from being able to backtrace correctly.

llvm-svn: 190642
This commit is contained in:
Richard Mitton 2013-09-12 23:38:30 +00:00
parent 3141d605b9
commit f70d60404d
1 changed files with 5 additions and 2 deletions

View File

@ -444,6 +444,8 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
unwind_plan.SetRegisterKind (m_reg_kind);
unwind_plan.SetReturnAddressRegister (cie->return_addr_reg_num);
std::vector<UnwindPlan::RowSP> stack;
UnwindPlan::Row::RegisterLocation reg_location;
while (m_cfi_data.ValidOffset(offset) && offset < end_offset)
{
@ -629,7 +631,7 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
// function.)
unwind_plan.AppendRow (row);
stack.push_back (row);
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *row.get();
row.reset (newrow);
@ -645,7 +647,8 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
// useful for compilers that move epilogue code into the body of a
// function.)
{
row = unwind_plan.GetRowAtIndex(unwind_plan.GetRowCount() - 1);
row = stack.back ();
stack.pop_back ();
}
break;