Fix gcj 4.3 regression

Andrew Haley aph@redhat.com
Thu Mar 13 18:20:00 GMT 2008


There's a bug in gcj 4.3 that causes mysterious ClassNotFoundExceptions.
This is caused by some broken code that attempts to enforce linker
constraints.

For 4.3-branch I'm just going to remove the check.  Once we have confidence in
its replacement we can back-port from trunk to 4.3-branch, but not yet.

Andrew.


2008-03-13  Andrew Haley  <aph@redhat.com>

        * link.cc (_Jv_Linker::resolve_method_entry): Remove broken class
        loader test.

Index: link.cc
===================================================================
--- link.cc	(revision 133172)
+++ link.cc	(working copy)
@@ -359,40 +359,6 @@
       throw new java::lang::NoSuchMethodError (sb->toString());
     }
 
-  // if (found_class->loader != klass->loader), then we
-  // must actually check that the types of arguments
-  // correspond.  That is, for each argument type, and
-  // the return type, doing _Jv_FindClassFromSignature
-  // with either loader should produce the same result,
-  // i.e., exactly the same jclass object. JVMS 5.4.3.3
-  if (found_class->loader != klass->loader)
-    {
-      JArray<jclass> *found_args, *klass_args;
-      jclass found_return, klass_return;
-
-      _Jv_GetTypesFromSignature (the_method,
-				 found_class,
-				 &found_args,
-				 &found_return);
-      _Jv_GetTypesFromSignature (the_method,
-				 klass,
-				 &klass_args,
-				 &klass_return);
-
-      jclass *found_arg = elements (found_args);
-      jclass *klass_arg = elements (klass_args);
-
-      for (int i = 0; i < found_args->length; i++)
-	{
-	  if (*(found_arg++) != *(klass_arg++))
-	    throw new java::lang::LinkageError (JvNewStringLatin1 
-	      ("argument type mismatch with different loaders"));
-	}
-      if (found_return != klass_return)
-	throw new java::lang::LinkageError (JvNewStringLatin1
-	  ("return type mismatch with different loaders"));
-    }
-  
   return the_method;
 }
 



More information about the Java mailing list