This is the mail archive of the
mailing list for the GCC 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.
2005-06-12 Per Bothner <email@example.com>
* class.c (inherits_from_p): Do load_class if needed.
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)
+ if (! CLASS_LOADED_P (type1))
+ load_class (type1, 1);
type1 = CLASSTYPE_SUPER (type1);