* java/lang/natClass.cc (_Jv_IsAssignableFrom): Checking the
ancestors array is invalid for interfaces, so do that *after*
check that the target type is not an interface.
From-SVN: r40797
+2001-03-23 Per Bothner <per@bothner.com>
+
+ * java/lang/natClass.cc (_Jv_IsAssignableFrom): Checking the
+ ancestors array is invalid for interfaces, so do that *after*
+ check that the target type is not an interface.
+
2000-03-23 Jeff Sturm <jsturm@one-point.com>
* prims.cc (_Jv_FindClassFromSignature): Check return of
jboolean
_Jv_IsAssignableFrom (jclass target, jclass source)
{
- if (source == target
- || (target == &ObjectClass && !source->isPrimitive())
- || (source->ancestors != NULL
- && source->ancestors[source->depth - target->depth] == target))
- return true;
+ if (source == target)
+ return true;
// If target is array, so must source be.
if (target->isArray ())
&& cl_idt->cls.itable[offset] == target)
return true;
}
+ return false;
}
-
- return false;
+
+ if ((target == &ObjectClass && !source->isPrimitive())
+ || (source->ancestors != NULL
+ && source->ancestors[source->depth - target->depth] == target))
+ return true;
+
+ return false;
}
// Interface type checking, the slow way. Returns TRUE if IFACE is a