This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch for an off by one error in _Jv_FindIIndex (another one)
- To: java at gcc dot gnu dot org
- Subject: Re: Patch for an off by one error in _Jv_FindIIndex (another one)
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Wed, 16 May 2001 10:51:26 +0200
- Cc: java-patches at gcc dot gnu dot org
- References: <20010516101404.A3175@keksy.muc.infineon.com>
- Reply-To: martin dot kahlert at infineon dot com
Hi!
I found another off by one error in the same file.
Here is the complete patch.
Bye,
Martin.
2001-05-16 Martin Kahlert <martin.kahlert@infineon.com>
* java/lang/natClass.cc (_Jv_FindIIndex): Fix an off by one error
* java/lang/natClass.cc (_Jv_IsAssignableFrom): Likewise
diff -rc gcc-20010514.orig/libjava/java/lang/natClass.cc gcc-20010514/libjava/java/lang/natClass.cc
*** gcc-20010514.orig/libjava/java/lang/natClass.cc Sun May 6 16:08:26 2001
--- gcc-20010514/libjava/java/lang/natClass.cc Wed May 16 10:39:46 2001
***************
*** 935,941 ****
if (__builtin_expect ((if_idt == NULL), false))
return false; // No class implementing TARGET has been loaded.
jshort cl_iindex = cl_idt->cls.iindex;
! if (cl_iindex <= if_idt->iface.ioffsets[0])
{
jshort offset = if_idt->iface.ioffsets[cl_iindex];
if (offset < cl_idt->cls.itable_length
--- 935,941 ----
if (__builtin_expect ((if_idt == NULL), false))
return false; // No class implementing TARGET has been loaded.
jshort cl_iindex = cl_idt->cls.iindex;
! if (cl_iindex < if_idt->iface.ioffsets[0])
{
jshort offset = if_idt->iface.ioffsets[cl_iindex];
if (offset < cl_idt->cls.itable_length
***************
*** 1319,1325 ****
{
if (j >= num)
goto found;
! if (i > ifaces[j]->idt->iface.ioffsets[0])
continue;
int ioffset = ifaces[j]->idt->iface.ioffsets[i];
/* We can potentially share this position with another class. */
--- 1319,1325 ----
{
if (j >= num)
goto found;
! if (i >= ifaces[j]->idt->iface.ioffsets[0])
continue;
int ioffset = ifaces[j]->idt->iface.ioffsets[i];
/* We can potentially share this position with another class. */
--
The early bird gets the worm. If you want something else for
breakfast, get up later.