X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libjava%2Fjni.cc;h=1abd2d2497ac70c72c7891eb353f68d672bd80b3;hb=87a9059882e0dd4fa7806a1100aa7b6bc55e38a9;hp=24ea04876d189fc3bd5751c75eb30cb3d44902d5;hpb=ce958f0eda1adc860081aa46cf5d6d0f62644285;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libjava/jni.cc b/libjava/jni.cc index 24ea04876d1..1abd2d2497a 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -1,6 +1,6 @@ // jni.cc - JNI implementation, including the jump table. -/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. @@ -26,7 +26,7 @@ details. */ #include #include #include -#include +#include #include #include #include @@ -325,7 +325,7 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj) // If we found a slot, or if the frame we just searched is the // mark frame, then we are done. - if (done || frame->marker != MARK_NONE) + if (done || frame == NULL || frame->marker != MARK_NONE) break; } @@ -2014,7 +2014,7 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name, if (function == NULL) { jstring str = JvNewStringUTF (name->data); - throw new java::lang::AbstractMethodError (str); + throw new java::lang::UnsatisfiedLinkError (str); } } @@ -2131,6 +2131,14 @@ _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args) _Jv_Free (env); return JNI_ERR; } + + env->locals->marker = MARK_SYSTEM; + env->locals->size = FRAME_SIZE; + env->locals->next = NULL; + + for (int i = 0; i < env->locals->size; ++i) + env->locals->vec[i] = NULL; + *penv = reinterpret_cast (env); // This thread might already be a Java thread -- this function might