properly handle classes with no interface table in isAssignableFrom()

This commit is contained in:
Joel Dice 2007-08-21 22:03:03 -06:00
parent 57d57ff7bf
commit a1caf06955

View File

@ -1694,9 +1694,11 @@ isAssignableFrom(Thread* t, object a, object b)
if (classFlags(t, a) & ACC_INTERFACE) {
for (; b; b = classSuper(t, b)) {
object itable = classInterfaceTable(t, b);
for (unsigned i = 0; i < arrayLength(t, itable); i += 2) {
if (arrayBody(t, itable, i) == a) {
return true;
if (itable) {
for (unsigned i = 0; i < arrayLength(t, itable); i += 2) {
if (arrayBody(t, itable, i) == a) {
return true;
}
}
}
}