From 3297bb4667ebba9490c4e692fb8ce64b1a0bcef3 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 9 Dec 2001 00:14:00 +0000 Subject: [PATCH] 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 --- libjava/ChangeLog | 5 +++++ libjava/verify.cc | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 04779dec1eb..15f5bd57063 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-12-08 Tom Tromey + + * verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow): + Handle case of array whose component type is not prepared. + 2001-12-07 Tom Tromey * java/lang/ClassLoader.java (defineClass): Rethrow any diff --git a/libjava/verify.cc b/libjava/verify.cc index b0206d15f98..74499ed4fa1 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -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)