diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d960f1b65ad..024955368ff 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,15 @@ +2001-05-18 Bryce McKinlay + + * include/jvm.h: Move "#pragma GCC java_exceptions" to ... + * gcj/javaprims.h: ... here. + * gnu/gcj/io/shs.cc: Add "#pragma GCC java_exceptions". + +2001-05-17 Martin Kahlert + + * java/lang/natClass.cc (_Jv_FindIIndex): Fix an off by one error + with length of ioffset table. + (_Jv_IsAssignableFrom): Likewise. + 2001-05-17 Per Bothner * Makefile.am (ZIP): The "fastjar" binary is now plain "jar". diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h index f16e97db903..e13195c7e77 100644 --- a/libjava/gcj/javaprims.h +++ b/libjava/gcj/javaprims.h @@ -11,6 +11,9 @@ details. */ #ifndef __JAVAPRIMS_H__ #define __JAVAPRIMS_H__ +// Force C++ compiler to use Java-style exceptions. +#pragma GCC java_exceptions + // FIXME: this is a hack until we get a proper gcjh. // It is needed to work around system header files that define TRUE // and FALSE. diff --git a/libjava/gnu/gcj/io/shs.cc b/libjava/gnu/gcj/io/shs.cc index 96b4f560352..b9a563c544c 100644 --- a/libjava/gnu/gcj/io/shs.cc +++ b/libjava/gnu/gcj/io/shs.cc @@ -10,6 +10,10 @@ * Comments to pgut1@cs.aukuni.ac.nz */ +// Force C++ compiler to use Java-style EH, so we don't have to link with +// libstdc++. +#pragma GCC java_exceptions + #include #include "shs.h" diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 1e80fbc3218..50af7569fb2 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -11,9 +11,6 @@ details. */ #ifndef __JAVA_JVM_H__ #define __JAVA_JVM_H__ -// Force C++ compiler to use Java-style exceptions. -#pragma GCC java_exceptions - #include #include diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index d7c2a54b521..e88bd830967 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -936,7 +936,7 @@ _Jv_IsAssignableFrom (jclass target, jclass source) if (__builtin_expect ((if_idt == NULL), false)) return false; // No class implementing TARGET has been loaded. jshort cl_iindex = cl_idt->cls.iindex; - if (cl_iindex <= if_idt->iface.ioffsets[0]) + if (cl_iindex < if_idt->iface.ioffsets[0]) { jshort offset = if_idt->iface.ioffsets[cl_iindex]; if (offset < cl_idt->cls.itable_length @@ -1181,8 +1181,7 @@ _Jv_GenerateITable (jclass klass, _Jv_ifaces *ifaces, jshort *itable_offsets) { jclass iface = ifaces->list[i]; itable_offsets[i] = itable_pos; - itable_pos = _Jv_AppendPartialITable (klass, iface, itable, - itable_pos); + itable_pos = _Jv_AppendPartialITable (klass, iface, itable, itable_pos); /* Create interface dispatch table for iface */ if (iface->idt == NULL) @@ -1325,7 +1324,7 @@ _Jv_FindIIndex (jclass *ifaces, jshort *offsets, jshort num) { if (j >= num) goto found; - if (i > ifaces[j]->idt->iface.ioffsets[0]) + if (i >= ifaces[j]->idt->iface.ioffsets[0]) continue; int ioffset = ifaces[j]->idt->iface.ioffsets[i]; /* We can potentially share this position with another class. */