Re: Potential Software Failure
Markus Dahm <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
David Dixon-Peugh wrote: > I have found what I believe to be a bug in BCEL, > and would like to see if anyone else has seen > this in the wild. > > Basically, I'm generating code that looks like this: > ACONST_NULL > ICONST( 0 ) > INVOKEVIRTUAL ( runTest(I)I ) > ICONST( 0 ) > IRETURN > [catch NullPointerException] > ICONST( 0 ) > IRETURN > > The idea is to force a NullPointerException to be > raised, and then catch it with a Catch clause. > > This is being done in a MethodGen object, using > "addExceptionHandler(...)" to create the > CodeExceptionGen inside the MethodGen. (Adding a > CodeExceptionGen is a good idea. We should be able > to do that directly.) Hmm. Maybe :) > When the MethodGen.getMethod() is called, if you take > a look at the "getExceptionTable()" result, you > basically get nothing. (Catch table wasn't written > to Method.) Where is the code of the exception handler, i.e, have you short example of your code. Cheers Markus