This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 5670 patch
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 14 Feb 2002 11:11:38 -0700
- Subject: Patch: FYI: PR 5670 patch
- Reply-to: tromey at redhat dot com
I'm checking this in.
This is a slightly modified version of the patch from PR 5670.
I've already checked in a Mauve verifier test for this.
Tom
Index: ChangeLog
from Todd Stock <toddastock@yahoo.com>
Fix for PR libgcj/5670:
* verify.cc (is_assignable_from_slow): If `source' is interface,
recursively look for merge with `target'.
Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.36
diff -u -r1.36 verify.cc
--- verify.cc 2002/02/13 17:12:27 1.36
+++ verify.cc 2002/02/14 17:46:32
@@ -259,10 +259,22 @@
if (source == NULL)
return false;
}
+ else if (source->isInterface ())
+ {
+ for (int i = 0; i < target->interface_count; ++i)
+ {
+ // We use a recursive call because we also need to
+ // check superinterfaces.
+ if (is_assignable_from_slow (target->interfaces[i], source))
+ return true;
+ }
+ target = target->getSuperclass ();
+ if (target == NULL)
+ return false;
+ }
else if (target == &java::lang::Object::class$)
return true;
- else if (source->isInterface ()
- || source == &java::lang::Object::class$)
+ else if (source == &java::lang::Object::class$)
return false;
else
source = source->getSuperclass ();