diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 2438a8d75d8..9688503e8c0 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2002-02-13 Todd Stock + + Fix for PR libgcj/5670: + * verify.cc (is_assignable_from_slow): If `source' is interface, + recursively look for merge with `target'. + 2002-02-14 Martin Kahlert * include/jni.h: Fix typo. diff --git a/libjava/verify.cc b/libjava/verify.cc index 38421f46ad6..ed734eab8f6 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -259,10 +259,22 @@ private: 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 ();