This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Is this bugfix correct (jni.cc)?
- To: java at gcc dot gnu dot org
- Subject: Re: Is this bugfix correct (jni.cc)?
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Thu, 7 Jun 2001 08:35:54 +0200
- References: <20010508170407.A2474@keksy.muc.infineon.com> <20010509084328.A20411@keksy.muc.infineon.com>
- Reply-To: martin dot kahlert at infineon dot com
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.