This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Is this bugfix correct (jni.cc)?


Hi!

This looks like a bug to me:
If there is no open slot, the while loop runs forever.

With the following patch, my progs work a lot better.
If we find an open slot, we are done, otherwise we are done, too,
since there is no other possibility where else we could search.

Please comment on this.
Thanks,
Martin.


2001-05-08  Martin Kahlert  <martin.kahlert@infineon.com>

	* jni.cc (_Jv_JNI_NewLocalRef): Fix infinite loop

*** jni.cc.orig	Tue May  8 16:59:35 2001
--- jni.cc	Tue May  8 16:58:02 2001
***************
*** 287,296 ****
  	if (frame->vec[i] == NULL)
  	  {
  	    set = true;
- 	    done = true;
  	    frame->vec[i] = obj;
  	    break;
  	  }
      }
  
    if (! set)
--- 287,296 ----
  	if (frame->vec[i] == NULL)
  	  {
  	    set = true;
  	    frame->vec[i] = obj;
  	    break;
  	  }
+       done = true;
      }
  
    if (! set)


-- 
The early bird gets the worm. If you want something else for       
breakfast, get up later.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]