Re: Potential Software Failure

"Juozas Baliuka" <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <00d001c231c6$01a8f1d0$0111010a@user>
Hi,
It is not a bug, exception handler has no code, code must be in method
instruction list.
Exeption handler has only indexes on stack and exception type.


> 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.)
>
> 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.)
>
> I presume this is a bug, if I'm doing something wrong
> let me know.
>
> DDP
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:[email protected]>
> For additional commands, e-mail: <mailto:[email protected]>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.