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]
Other format: [Raw text]

Patch: FYI: verifier fixlet


I'm checking this in.

This fixes a small verifier bug.  We could have array classes where
the component type wasn't resolved.  Now we handle this case.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

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

Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.23
diff -u -r1.23 verify.cc
--- verify.cc 2001/12/07 19:53:34 1.23
+++ verify.cc 2001/12/08 19:40:22
@@ -237,12 +237,9 @@
 	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 @@
 	    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)


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