patch for _Jv_IsAssignableFrom

Bryce McKinlay bryce@albatross.co.nz
Thu Mar 22 03:18:00 GMT 2001


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 ]




More information about the Java-patches mailing list