This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
No Subject
- To: egcs at cygnus dot com
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 18 May 1998 16:50:53 +0100
- Cc: richard dot earnshaw at arm dot com
- Cc: jason at cygnus dot com
- Organization: Advanced RISC Machines Ltd.
- Reply-To: richard dot earnshaw at arm dot com
There is an off-by-one error in the stor-layout change of last Friday.
The TYPE_BINFO_SIZE macro uses the vector element 6, which is the 7th
element of the array. This causes sporadic memory corruption problems.
<date> Richard Earnshaw (rearnsha@arm.com)
* stor-layout.c (layout_record): Fix off-by-one error when checking
length of the TYPE_BINFO vector.
Index: stor-layout.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stor-layout.c,v
retrieving revision 1.14
diff -p -r1.14 stor-layout.c
*** stor-layout.c 1998/05/15 18:56:10 1.14
--- stor-layout.c 1998/05/18 15:44:21
*************** layout_record (rec)
*** 551,557 ****
/* Record the un-rounded size in the binfo node. But first we check
the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
! if (TYPE_BINFO (rec) && TREE_VEC_LENGTH (TYPE_BINFO (rec)) >= 6)
TYPE_BINFO_SIZE (rec) = TYPE_SIZE (rec);
#ifdef ROUND_TYPE_SIZE
--- 551,557 ----
/* Record the un-rounded size in the binfo node. But first we check
the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
! if (TYPE_BINFO (rec) && TREE_VEC_LENGTH (TYPE_BINFO (rec)) > 6)
TYPE_BINFO_SIZE (rec) = TYPE_SIZE (rec);
#ifdef ROUND_TYPE_SIZE