summaryrefslogtreecommitdiff
path: root/gcc/unwind-dw2.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-01 06:01:47 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-01 06:01:47 +0000
commitc49ad9ef92ccbf9ca427e3cd0e359f42fd11a809 (patch)
tree20abd603a5bcb42f4ffe7929126e0ebc032fc438 /gcc/unwind-dw2.c
parent853f6a41c245ec7ae212fce1223b05c69f1717bc (diff)
downloadgcc-c49ad9ef92ccbf9ca427e3cd0e359f42fd11a809.tar.gz
* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Honor
DWARF_ALT_FRAME_RETURN_COLUMN. * unwind-dw2.c (dwarf_reg_size_table): Expand by one. (_Unwind_GetGR, _Unwind_SetGR): Validate lookup column. (uw_frame_state_for): Return end-of-stack for null return address. * doc/tm.texi (DWARF_ALT_FRAME_RETURN_COLUMN): Add. * config/alpha/alpha.c (alpha_sa_mask): Add r31 for eh_return. (alpha_expand_prologue): Store a zero for it. (alpha_expand_epilogue): Don't reload it. * config/alpha/alpha.h (DWARF_ALT_FRAME_RETURN_COLUMN): New. * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): Use column 64 for the sigframe return address. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unwind-dw2.c')
-rw-r--r--gcc/unwind-dw2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index f94eaf99da9..09396c80754 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -82,7 +82,7 @@ struct _Unwind_Context
};
/* Byte size of every register managed by these routines. */
-static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS];
+static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS+1];
/* The result of interpreting the frame unwind info for a frame.
@@ -186,6 +186,8 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
void *ptr;
index = DWARF_REG_TO_UNWIND_COLUMN (index);
+ if (index >= sizeof(dwarf_reg_size_table))
+ abort ();
size = dwarf_reg_size_table[index];
ptr = context->reg[index];
@@ -222,6 +224,8 @@ _Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
void *ptr;
index = DWARF_REG_TO_UNWIND_COLUMN (index);
+ if (index >= sizeof(dwarf_reg_size_table))
+ abort ();
size = dwarf_reg_size_table[index];
ptr = context->reg[index];
@@ -1002,6 +1006,9 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
context->args_size = 0;
context->lsda = 0;
+ if (context->ra == 0)
+ return _URC_END_OF_STACK;
+
fde = _Unwind_Find_FDE (context->ra - 1, &context->bases);
if (fde == NULL)
{