aboutsummaryrefslogtreecommitdiff
path: root/gcc/unwind-dw2.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-09-30 23:01:47 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-09-30 23:01:47 -0700
commited80cd6809e600cf021fc66cbc1d5fa5c682cab7 (patch)
tree20abd603a5bcb42f4ffe7929126e0ebc032fc438 /gcc/unwind-dw2.c
parent6ab7003d15f074b44f4a521a7ac46b9759492f86 (diff)
downloadgcc-ed80cd6809e600cf021fc66cbc1d5fa5c682cab7.zip
gcc-ed80cd6809e600cf021fc66cbc1d5fa5c682cab7.tar.gz
gcc-ed80cd6809e600cf021fc66cbc1d5fa5c682cab7.tar.bz2
dwarf2out.c (expand_builtin_init_dwarf_reg_sizes): Honor DWARF_ALT_FRAME_RETURN_COLUMN.
* 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. From-SVN: r71967
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 f94eaf9..09396c8 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)
{