if (fc->col_type[r] != DW_CFA_unreferenced)
{
if (r == fc->ra)
- printf ("ra ");
+ printf ("ra ");
else
printf ("%-5s ", regname (r, 1));
}
break;
case DW_CFA_restore:
- if (opa >= (unsigned int) cie->ncols
- || opa >= (unsigned int) fc->ncols)
+ if (opa >= (unsigned int) fc->ncols)
reg_prefix = bad_reg;
if (! do_debug_frames_interp || *reg_prefix != '\0')
printf (" DW_CFA_restore: %s%s\n",
reg_prefix, regname (opa, 0));
- if (*reg_prefix == '\0')
+ if (*reg_prefix != '\0')
+ break;
+
+ if (opa >= (unsigned int) cie->ncols
+ || (do_debug_frames_interp
+ && cie->col_type[opa] == DW_CFA_unreferenced))
+ {
+ fc->col_type[opa] = DW_CFA_undefined;
+ fc->col_offset[opa] = 0;
+ }
+ else
{
fc->col_type[opa] = cie->col_type[opa];
fc->col_offset[opa] = cie->col_offset[opa];
- if (do_debug_frames_interp
- && fc->col_type[opa] == DW_CFA_unreferenced)
- fc->col_type[opa] = DW_CFA_undefined;
}
break;
case DW_CFA_restore_extended:
reg = LEB ();
- if (reg >= (unsigned int) cie->ncols
- || reg >= (unsigned int) fc->ncols)
+ if (reg >= (unsigned int) fc->ncols)
reg_prefix = bad_reg;
if (! do_debug_frames_interp || *reg_prefix != '\0')
printf (" DW_CFA_restore_extended: %s%s\n",
reg_prefix, regname (reg, 0));
- if (*reg_prefix == '\0')
+ if (*reg_prefix != '\0')
+ break;
+
+ if (reg >= (unsigned int) cie->ncols)
+ {
+ fc->col_type[reg] = DW_CFA_undefined;
+ fc->col_offset[reg] = 0;
+ }
+ else
{
fc->col_type[reg] = cie->col_type[reg];
fc->col_offset[reg] = cie->col_offset[reg];