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]

Re: [BC] Patch: FYI: linking -vs- verification


Tom Tromey wrote:

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

	* link.cc (verify_type_assertions): Ensure classes have supers
	linked.  Strip off array types first.

Index: link.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Attic/link.cc,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 link.cc
--- link.cc 5 Nov 2004 19:30:11 -0000 1.1.2.10
+++ link.cc 6 Nov 2004 03:39:31 -0000
@@ -1632,6 +1632,17 @@
	  if (cl1 == NULL || cl2 == NULL)
	    continue;

+ // Strip off array types before trying to link supers. This
+ // is somewhat ugly, since it duplicates some logic from
+ // _Jv_IsAssignableFromSlow.
+ while (cl1->isArray () && cl2->isArray ())
+ {
+ cl1 = cl1->getComponentType ();
+ cl2 = cl2->getComponentType ();
+ }
+ wait_for_state (cl1, JV_STATE_LOADING);
+ wait_for_state (cl2, JV_STATE_LOADING);
+
if (! _Jv_IsAssignableFromSlow (cl2, cl1))
{
jstring s = JvNewStringUTF ("Incompatible types: In class ");



Perhaps we can just put the wait_for_state()'s in _Jv_IsAssignableFromSlow()? I can imagine other places where we might try to call this on a class that hasn't been loaded.


Regards

Bryce


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