mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-03 21:40:19 +08:00
* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
From-SVN: r43415
This commit is contained in:
parent
827a5be702
commit
a5c30a8cff
@ -1,3 +1,7 @@
|
||||
2001-06-15 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
|
||||
|
||||
2001-06-15 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
|
||||
|
@ -278,16 +278,23 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj)
|
||||
// Try to find an open slot somewhere in the topmost frame.
|
||||
_Jv_JNI_LocalFrame *frame = env->locals;
|
||||
bool done = false, set = false;
|
||||
while (frame != NULL && ! done)
|
||||
for (; frame != NULL && ! done; frame = frame->next)
|
||||
{
|
||||
for (int i = 0; i < frame->size; ++i)
|
||||
if (frame->vec[i] == NULL)
|
||||
{
|
||||
set = true;
|
||||
done = true;
|
||||
frame->vec[i] = obj;
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (frame->vec[i] == NULL)
|
||||
{
|
||||
set = true;
|
||||
done = true;
|
||||
frame->vec[i] = obj;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
break;
|
||||
}
|
||||
|
||||
if (! set)
|
||||
|
Loading…
Reference in New Issue
Block a user