diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-14 17:48:36 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-14 17:48:36 +0000 |
commit | 4f4d419140e5aa6d928aec7c30d6f1347811154c (patch) | |
tree | 7645434815392b2fd12c17e6cdea16812d401fc7 /libjava/verify.cc | |
parent | d1e8a831ca4f79ee131a238696625c2b415692fa (diff) | |
download | gcc-4f4d419140e5aa6d928aec7c30d6f1347811154c.tar.gz |
2002-02-13 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'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49769 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/verify.cc')
-rw-r--r-- | libjava/verify.cc | 16 |
1 files changed, 14 insertions, 2 deletions
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 (); |