This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Is this bugfix correct (jni.cc)?
- To: java at gcc dot gnu dot org
- Subject: Is this bugfix correct (jni.cc)?
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Tue, 8 May 2001 17:04:07 +0200
- Cc: java-patches at gcc dot gnu dot org
- Reply-To: martin dot kahlert at infineon dot com
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.