This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[JAVA]: Fix PR 23620
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Tom Tromey <tromey at redhat dot com>, wmahan at gmail dot com
- Date: Wed, 12 Oct 2005 11:53:41 +0100
- Subject: [JAVA]: Fix PR 23620
[apologies for the dual post: auto completeion snafu]
This patch fixes pr 23620, something I broke in binfo reorganization. I tried
to trace the class loading logic to figure out if that was doing something
wrong, but got lost.
Wil's suggestion was the most pragmatic solution I could find. I added a check
in set_super_info to not reallocate the binfo if there are no supers (this might
or might not be necessary).
built & tested on i686-pc-linux-gnu, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-10-12 Nathan Sidwell <nathan@codesourcery.com>
Wil Mahan <wmahan@gmail.com>
PR java/23620
* class.c (make_class): Create empty binfo here.
(set_super_info): Only create binfo if we have superclasses.
Index: java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.241
diff -c -3 -p -r1.241 class.c
*** java/class.c 21 Sep 2005 13:34:28 -0000 1.241
--- java/class.c 12 Oct 2005 10:37:54 -0000
*************** make_class (void)
*** 319,324 ****
--- 319,327 ----
{
tree type;
type = make_node (RECORD_TYPE);
+ /* Unfortunately we must create the binfo here, so that class
+ loading works. */
+ TYPE_BINFO (type) = make_tree_binfo (0);
MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type);
return type;
*************** set_super_info (int access_flags, tree t
*** 468,474 ****
if (super_class)
total_supers++;
! TYPE_BINFO (this_class) = make_tree_binfo (total_supers);
TYPE_VFIELD (this_class) = TYPE_VFIELD (object_type_node);
if (super_class)
{
--- 471,478 ----
if (super_class)
total_supers++;
! if (total_supers)
! TYPE_BINFO (this_class) = make_tree_binfo (total_supers);
TYPE_VFIELD (this_class) = TYPE_VFIELD (object_type_node);
if (super_class)
{