RE: [Ikvm-developers] exception handling problem
Brought to you by:
jfrijters
From: Jeroen F. <je...@su...> - 2003-05-24 08:25:15
|
Hi, I backed out my earlier change and checked in the real fix of the problem: Index: IK.VM.NET/compiler.cs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/ikvm/ikvm/IK.VM.NET/compiler.cs,v retrieving revision 1.14 diff -u -r1.14 compiler.cs --- IK.VM.NET/compiler.cs 23 May 2003 07:30:21 -0000 1.14 +++ IK.VM.NET/compiler.cs 24 May 2003 08:22:48 -0000 @@ -193,9 +193,7 @@ ExceptionTableEntry ei =3D (ExceptionTableEntry)ar[i]; for(int j =3D FindPcIndex(ei.start_pc), e =3D FindPcIndex(ei.end_pc); j < e; j++) { - // TODO we probably should handle other branches here as well... - if(m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__jsr - || m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__goto) + if(m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__jsr) { int targetPC =3D m.Instructions[j].NormalizedArg1 + m.Instructions[j].PC; if(targetPC < ei.start_pc || targetPC >=3D ei.end_pc) @@ -273,8 +271,7 @@ for(int i =3D 0; i < ar.Count; i++) { ExceptionTableEntry ei =3D (ExceptionTableEntry)ar[i]; - // TODO verify that we don't need to start at j =3D 0 - for(int j =3D i; j < ar.Count; j++) + for(int j =3D 0; j < ar.Count; j++) { ExceptionTableEntry ej =3D (ExceptionTableEntry)ar[j]; if(ej.handler_pc > ei.start_pc && ej.handler_pc < ei.end_pc)=20 Regards, Jeroen >=20 > -----Original Message----- > From: Jeroen Frijters [mailto:je...@su...]=20 > Sent: Friday, May 23, 2003 09:28 > To: Varga Zoltan; ikv...@li... >=20 > Hi, >=20 > Thanks! Good catch. I checked in a fix for this problem, but=20 > as the comment says, the other jumps out of the try block=20 > should probably be handled as well. >=20 > Here is the patch I checked in: > Index: IK.VM.NET/compiler.cs > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/ikvm/ikvm/IK.VM.NET/compiler.cs,v > retrieving revision 1.13 > diff -u -r1.13 compiler.cs > --- IK.VM.NET/compiler.cs 18 Apr 2003 10:27:33 -0000 1.13 > +++ IK.VM.NET/compiler.cs 23 May 2003 07:29:25 -0000 > @@ -193,7 +193,9 @@ > ExceptionTableEntry ei =3D > (ExceptionTableEntry)ar[i]; > for(int j =3D=20 > FindPcIndex(ei.start_pc), e =3D FindPcIndex(ei.end_pc); j < e; j++) > { > - > if(m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__jsr) > + // TODO we probably should > handle other branches here as well... > + > if(m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__jsr > + || > m.Instructions[j].NormalizedOpCode =3D=3D NormalizedByteCode.__goto) > { > int targetPC =3D > m.Instructions[j].NormalizedArg1 + m.Instructions[j].PC; > if(targetPC < > ei.start_pc || targetPC >=3D ei.end_pc) >=20 > Regards, > Jeroen >=20 > >=20 > > -----Original Message----- > > From: Varga Zoltan [mailto:va...@fr...] > > Sent: Friday, May 23, 2003 00:03 > > To: ikv...@li... > >=20 > >=20 > >=20 > > Hi, > >=20 > > Running the attached testcase under IKVM produces no=20 > output, while it=20 > > prints 'OK' while running under JDK 1.3.1. This code is=20 > from xerces,=20 > > and it is causing some problems when trying to run eclipse. > >=20 > > bye > >=20 > > Zoltan > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application=20 > fit in a relational database is painful, don't do it! Check=20 > out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers >=20 |