This is the mail archive of the java@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]

Re: Is this bugfix correct (jni.cc)?


Hi!

Did anybody look into that upto now? Is the fix correct, or is it wrong?
The code produces and infinite loop for my apps.

Thanks,
Martin.

PS: Sorry, if the fix is in cvs right now, but i only use snapshots and
    the last one doesn't contain it.


On Wed, May 09, 2001 at 08:43:28AM +0200, Martin Kahlert wrote:
> 2001-05-09  Martin Kahlert  <martin.kahlert@infineon.com>
> 
> 	* jni.cc (_Jv_JNI_NewLocalRef): Search next frame, if
> 	we could not find free slot in this one. Fixes infinite loop.
> 
> *** jni.cc.orig	Tue May  8 16:59:35 2001
> --- jni.cc	Wed May  9 08:38:38 2001
> ***************
> *** 280,296 ****
>   {
>     // 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 (int i = 0; i < frame->size; ++i)
>   	if (frame->vec[i] == NULL)
>   	  {
>   	    set = true;
> - 	    done = true;
>   	    frame->vec[i] = obj;
>   	    break;
>   	  }
>       }
>   
>     if (! set)
> --- 280,296 ----
>   {
>     // Try to find an open slot somewhere in the topmost frame.
>     _Jv_JNI_LocalFrame *frame = env->locals;
> !   bool set = false;
> !   while (frame != NULL && ! set)
>       {
>         for (int i = 0; i < frame->size; ++i)
>   	if (frame->vec[i] == NULL)
>   	  {
>   	    set = true;
>   	    frame->vec[i] = obj;
>   	    break;
>   	  }
> +       frame = frame->next;
>       }
>   
>     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]