[ecj] Abort if we are ABI-incompatible

Andrew Haley aph@redhat.com
Thu Nov 23 16:12:00 GMT 2006


At the moment, if we have a linkage error caused by an incompatible
ABI version we just segfault at some random place rather than
displaying an error message.  This is a Bad Thing.

Andrew.


2006-11-23  Andrew Haley  <aph@redhat.com>

	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Abort if we
	are ABI-incompatible.

Index: java/lang/natClassLoader.cc
===================================================================
--- java/lang/natClassLoader.cc (revision 119120)
+++ java/lang/natClassLoader.cc (working copy)
@@ -196,6 +196,12 @@
 
       if (_Jv_CheckABIVersion ((unsigned long) klass->next_or_version))
        (*_Jv_RegisterClassHook) (klass);
+      else
+       {
+         fprintf (stderr, "ABI mismatch: library is compiled with "
+                  "the wrong version of gcj\n");
+         abort ();
+       }
     }
 }
 



More information about the Java-patches mailing list