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 fix


I'm checking this in.  The verifier was initializing classes when
checking for assignment compatibility.  However, this shouldn't
happen, and it causes errors when it does.  This patch changes the
verifier to use a method that doesn't cause classes to be initialized.

Tom

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

	* verify.cc (type::compatible): Use _Jv_IsAssignableFrom.
	(type::merge): Likewise.

Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.4
diff -u -r1.4 verify.cc
--- verify.cc 2001/11/15 00:24:38 1.4
+++ verify.cc 2001/11/16 01:25:11
@@ -373,7 +373,9 @@
       // We must resolve both types and check assignability.
       resolve ();
       k.resolve ();
-      return data.klass->isAssignableFrom (k.data.klass);
+      // Use _Jv_IsAssignableFrom to avoid premature class
+      // initialization.
+      return _Jv_IsAssignableFrom (data.klass, k.data.klass);
     }
 
     bool isvoid () const
@@ -537,7 +539,9 @@
 		  // This loop will end when we hit Object.
 		  while (true)
 		    {
-		      if (k->isAssignableFrom (oldk))
+		      // Use _Jv_IsAssignableFrom to avoid premature
+		      // class initialization.
+		      if (_Jv_IsAssignableFrom (k, oldk))
 			break;
 		      k = k->getSuperclass ();
 		      changed = true;


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