summaryrefslogtreecommitdiffstats
path: root/libjava/java/lang/natRuntime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/natRuntime.cc')
-rw-r--r--libjava/java/lang/natRuntime.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index ecaf7d314a2..64c8fbb3f90 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -207,7 +207,14 @@ java::lang::Runtime::_load (jstring path, jboolean do_search)
// FIXME: what?
return;
}
+
+ // Push a new frame so that JNI_OnLoad will get the right class
+ // loader if it calls FindClass.
+ ::java::lang::ClassLoader *loader
+ = _Jv_StackTrace::GetFirstNonSystemClassLoader();
+ JNIEnv *env = _Jv_GetJNIEnvNewFrameWithLoader (loader);
jint vers = ((jint (JNICALL *) (JavaVM *, void *)) onload) (vm, NULL);
+ _Jv_JNI_PopSystemFrame (env);
if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2
&& vers != JNI_VERSION_1_4)
{
OpenPOWER on IntegriCloud