]> gcc.gnu.org Git - gcc.git/commitdiff
* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
authorTom Tromey <tromey@redhat.com>
Fri, 15 Jun 2001 23:44:45 +0000 (23:44 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 15 Jun 2001 23:44:45 +0000 (23:44 +0000)
From-SVN: r43415

libjava/ChangeLog
libjava/jni.cc

index 9d20d86d6eeb3c044dcddd1d4ca5b2f658250723..bb1463c4b86f930771df57878d5e489a21e71a30 100644 (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
index 15f69bcce70fa5b255261f4fd277adf7633ba47f..3944b0e0bea0e2f9386c95c725e49da68c845fe4 100644 (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)
This page took 0.0783700000000001 seconds and 5 git commands to generate.