This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
PATH to inherits_from_p
- From: Per Bothner <per at bothner dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Sun, 12 Jun 2005 13:01:36 -0700
- Subject: PATH to inherits_from_p
I checked the atached patch into mainline.
It is probably appropriate for 4.0.2.
The problem is that CLASSTYPE_SUPER may be unset if we haven't loaded
the class yet, which can obviously lead to various failures. In the
case that motivated the patch, I got an error about a throws specifier
because it there's wasn't a matching throws in the super class.
However, it wasm't needed since it was a RuntimeException.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
2005-06-12 Per Bothner <per@bothner.com>
* class.c (inherits_from_p): Do load_class if needed.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.231
diff -u -p -r1.231 class.c
--- class.c 3 Jun 2005 04:06:19 -0000 1.231
+++ class.c 12 Jun 2005 19:53:36 -0000
@@ -549,6 +549,8 @@ inherits_from_p (tree type1, tree type2)
{
if (type1 == type2)
return 1;
+ if (! CLASS_LOADED_P (type1))
+ load_class (type1, 1);
type1 = CLASSTYPE_SUPER (type1);
}
return 0;