+2003-01-14 Andrew Haley <aph@redhat.com>
+
+ * java/lang/natRuntime.cc (_load): StackTrace access needs to be
+ in a try block.
+
2003-01-10 Andrew Haley <aph@redhat.com>
* include/dwarf2-signal.h: Remove x86_64.
#include <java/lang/ConcreteProcess.h>
#include <java/lang/ClassLoader.h>
#include <gnu/gcj/runtime/StackTrace.h>
+#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <jni.h>
ClassLoader *sys = ClassLoader::getSystemClassLoader();
ClassLoader *look = NULL;
gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace(10);
- for (int i = 0; i < 10; ++i)
- {
- jclass klass = t->classAt(i);
- if (klass != NULL)
+ try
+ {
+ for (int i = 0; i < 10; ++i)
{
- ClassLoader *loader = klass->getClassLoaderInternal();
- if (loader != NULL && loader != sys)
+ jclass klass = t->classAt(i);
+ if (klass != NULL)
{
- look = loader;
- break;
+ ClassLoader *loader = klass->getClassLoaderInternal();
+ if (loader != NULL && loader != sys)
+ {
+ look = loader;
+ break;
+ }
}
}
}
+ catch (::java::lang::ArrayIndexOutOfBoundsException *e)
+ {
+ }
+
if (look != NULL)
{
// Don't include solib prefix in string passed to