Is this bugfix correct (jni.cc)?

Martin Kahlert martin.kahlert@infineon.com
Tue May 8 08:04:00 GMT 2001


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.



More information about the Java-patches mailing list