Commit 4cf0d20f by Andrew Haley Committed by Andrew Haley

natRuntime.cc (_load): StackTrace access needs to be in a try block.

2003-01-14  Andrew Haley  <aph@redhat.com>

        * java/lang/natRuntime.cc (_load): StackTrace access needs to be
        in a try block.

From-SVN: r61293
parent d9bbf3f7
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.
......
......@@ -29,6 +29,7 @@ details. */
#include <java/lang/ConcreteProcess.h>
#include <java/lang/ClassLoader.h>
#include <gnu/gcj/runtime/StackTrace.h>
#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <jni.h>
......@@ -181,19 +182,26 @@ java::lang::Runtime::_load (jstring path, jboolean do_search)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment