mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-28 06:14:10 +08:00
jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not dereferenced.
2002-02-08 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not dereferenced. (_Jv_JNI_AttachCurrentThread): Produce full featured env->locals frame. From-SVN: r49615
This commit is contained in:
parent
e7d7a7a734
commit
d3ae0d490d
@ -1,3 +1,10 @@
|
||||
2002-02-08 Martin Kahlert <martin.kahlert@infineon.com>
|
||||
|
||||
* jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not
|
||||
dereferenced.
|
||||
(_Jv_JNI_AttachCurrentThread): Produce full featured env->locals
|
||||
frame.
|
||||
|
||||
2002-02-07 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* java/io/natFile.cc (_access): Use __builtin_alloca.
|
||||
|
@ -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.
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -2131,6 +2131,15 @@ _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 = env->locals;
|
||||
env->locals = NULL;
|
||||
|
||||
for (int i = 0; i < env->locals->size; ++i)
|
||||
env->locals->vec[i] = NULL;
|
||||
|
||||
*penv = reinterpret_cast<void *> (env);
|
||||
|
||||
// This thread might already be a Java thread -- this function might
|
||||
|
Loading…
Reference in New Issue
Block a user