verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow): Handle case of array whose component type is not prepared.

* verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow):
	Handle case of array whose component type is not prepared.

From-SVN: r47799
This commit is contained in:
Tom Tromey 2001-12-09 00:14:00 +00:00 committed by Tom Tromey
parent ecbcf7b319
commit 3297bb4667
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2001-12-08 Tom Tromey <tromey@redhat.com>
* verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow):
Handle case of array whose component type is not prepared.
2001-12-07 Tom Tromey <tromey@redhat.com>
* java/lang/ClassLoader.java (defineClass): Rethrow any

View File

@ -237,12 +237,9 @@ private:
if (target->isPrimitive () || source->isPrimitive ())
return false;
// _Jv_IsAssignableFrom can handle a target which is an
// interface even if it hasn't been prepared.
if ((target->state > JV_STATE_LINKED || target->isInterface ())
&& source->state > JV_STATE_LINKED)
return _Jv_IsAssignableFrom (target, source);
// Check array case first because we can have an array whose
// component type is not prepared; _Jv_IsAssignableFrom
// doesn't handle this correctly.
if (target->isArray ())
{
if (! source->isArray ())
@ -250,6 +247,11 @@ private:
target = target->getComponentType ();
source = source->getComponentType ();
}
// _Jv_IsAssignableFrom can handle a target which is an
// interface even if it hasn't been prepared.
else if ((target->state > JV_STATE_LINKED || target->isInterface ())
&& source->state > JV_STATE_LINKED)
return _Jv_IsAssignableFrom (target, source);
else if (target->isInterface ())
{
for (int i = 0; i < source->interface_count; ++i)