This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Java: Fix TYPE_BINFO regression
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Andrew Haley <aph at redhat dot com>, java-patches at gcc dot gnu dot org
- Date: Fri, 09 Jul 2004 19:25:12 -0400
- Subject: Java: Fix TYPE_BINFO regression
- References: <40EEE337.9080700@codesourcery.com>
This patch caused a Java testsuite regression for
libjava.compile/iface.java. The problem is that interface_of_p can
segfault due to lack of TYPE_BINFO if set_super_info() has not yet been
called on java.lang.Object. I'm checking in the patch below under the
"obvious" rule.
Regards
Bryce
2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
* class.c (interface_of_p): Check for null TYPE_BINFO.
--- class.c 9 Jul 2004 18:36:02 -0000 1.195
+++ class.c 9 Jul 2004 23:18:33 -0000
@@ -533,8 +533,9 @@
int n, i;
tree basetype_vec;
- if (!(basetype_vec = BINFO_BASE_BINFOS (TYPE_BINFO (type2))))
+ if (! TYPE_BINFO (type2))
return 0;
+ basetype_vec = BINFO_BASE_BINFOS (TYPE_BINFO (type2));
n = TREE_VEC_LENGTH (basetype_vec);
for (i = 0; i < n; i++)
{
Nathan Sidwell wrote:
This patch moves the java binfo construction next to the base binfo
vector,
for the same reasons I changed C++%. Fortunately, Java was waay simpler!
built & tested on i686-pc-linux-gnu, ok?
nathan
% http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00902.html if you
missed it.
------------------------------------------------------------------------
2004-07-09 Nathan Sidwell <nathan@codesourcery.com>
* class.c (make_class): Do not create binfo here.
(set_super_info): Create it here.
* java-tree.h (CLASS_HAS_SUPER): Cope with lack of a binfo.