* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.

From-SVN: r43415
This commit is contained in:
Tom Tromey 2001-06-15 23:44:45 +00:00 committed by Tom Tromey
parent 827a5be702
commit a5c30a8cff
2 changed files with 19 additions and 8 deletions

View File

@ -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

View File

@ -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)