2007-01-31 Andrew Haley <aph@redhat.com>
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Jan 2007 19:04:35 +0000 (19:04 +0000)
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 31 Jan 2007 19:04:35 +0000 (19:04 +0000)
        * prims.cc (_Jv_Abort): fflush (stderr).
        * java/lang/natClassLoader.cc (_Jv_CheckABIVersion): Abort.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121433 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/lang/natClassLoader.cc
libjava/prims.cc

index 40ce7ee..8dde1eb 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-31  Andrew Haley  <aph@redhat.com>
+
+       * prims.cc (_Jv_Abort): fflush (stderr).
+       * java/lang/natClassLoader.cc (_Jv_CheckABIVersion): Abort.
+
 2007-01-31  Tom Tromey  <tromey@redhat.com>
 
        * configure, Makefile.in: Rebuilt.
index 9c1a6a2..e62c6d3 100644 (file)
@@ -208,6 +208,12 @@ _Jv_CheckABIVersion (unsigned long value)
       // C++ ABI
       if (version == GCJ_CXX_ABI_VERSION)
        return;
+
+      // If we've loaded a library that uses the C++ ABI, and this
+      // library is an incompatible version, then we're dead.  There's
+      // no point throwing an exception: that will crash.
+      JvFail ("gcj linkage error.\n"
+             "Incorrect library ABI version detected.  Aborting.\n");
     }
 
   throw new ::java::lang::ClassFormatError
index e205dbb..a419120 100644 (file)
@@ -458,6 +458,7 @@ _Jv_Abort (const char *, const char *, int, const char *message)
 #else
   fprintf (stderr, "libgcj failure: %s\n", message);
 #endif
+  fflush (stderr);
   abort ();
 }