[BC] Patch: FYI: linking -vs- verification
Bryce McKinlay
mckinlay@redhat.com
Mon Nov 8 15:20:00 GMT 2004
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
More information about the Java-patches
mailing list