This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

throw array bounds error


Since changing struct frame_state to use DWARF_FRAME_REGISTERS, we've
been iterating too far in throw.  Only by accident it hadn't shown up
so far. 

Jan, this is the cause of the EH failures in your soft frame pointer
patch.  Adding the new hard reg made us iterate even farther out of
bounds, and we finally bumped into non-zero garbage.



r~

        * libgcc2.c (dwarf_reg_size_table): Size with DWARF_FRAME_REGISTERS.
        (throw_helper): Iterate over DWARF_FRAME_REGISTERS.

Index: libgcc2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/libgcc2.c,v
retrieving revision 1.82
diff -c -p -d -r1.82 libgcc2.c
*** libgcc2.c	1999/12/29 21:22:16	1.82
--- libgcc2.c	2000/01/23 22:30:29
*************** __get_eh_info (void)
*** 3241,3247 ****
  
  #ifdef DWARF2_UNWIND_INFO
  static int dwarf_reg_size_table_initialized = 0;
! static char dwarf_reg_size_table[FIRST_PSEUDO_REGISTER];
  
  static void
  init_reg_size_table (void)
--- 3241,3247 ----
  
  #ifdef DWARF2_UNWIND_INFO
  static int dwarf_reg_size_table_initialized = 0;
! static char dwarf_reg_size_table[DWARF_FRAME_REGISTERS];
  
  static void
  init_reg_size_table (void)
*************** throw_helper (struct eh_context *eh, voi
*** 3949,3955 ****
  	  udata = next_stack_level (pc, udata, sub_udata);
  	  sub_udata = p;
  
! 	  for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
  	    if (i != udata->retaddr_column && udata->saved[i])
  	      {
  		/* If you modify the saved value of the return address
--- 3949,3955 ----
  	  udata = next_stack_level (pc, udata, sub_udata);
  	  sub_udata = p;
  
! 	  for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
  	    if (i != udata->retaddr_column && udata->saved[i])
  	      {
  		/* If you modify the saved value of the return address

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]