This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: patch for _Jv_IsAssignableFrom
- To: Per Bothner <per at bothner dot com>
- Subject: Re: patch for _Jv_IsAssignableFrom
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 22 Mar 2001 23:19:04 +1200
- CC: java-patches at gcc dot gnu dot org
- References: <m2itl3rp4j.fsf@kelso.bothner.com>
Per Bothner wrote:
> I ran into this problem when (x instanceof I) for an interface I
> returned true when it shouldn't have. It turned out that the
> source->ancestors[source->depth - target->depth] == target test
> was accidentally succeeding, because the source->ancestors array
> was being accessed outside its bounds!
Odd, because source->ancestors should always be NULL for an interface??
> Ok to check in?
Yes, this looks ok to me, although it would be nice to keep the class test
first because that is presumably the most common case. Ultimately, this will
be split up into separate methods (one for interfaces, one for classes) and
the compiler will be smart about which one it calls (or will just inline the
tests).
regards
[ bryce ]