This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patch for _Jv_IsAssignableFrom


Bryce McKinlay wrote:

> 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??

I got that confused. In this case, "target" is the interface. depth is 0 for an
interface, and class->ancestors[class->depth - 0] will indeed produce an access
beyond the end of the array, as the length of ancestors == depth.

regards

  [ bryce ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]