RE: Try/Catch Errors

Paul McLachlan <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <[email protected]>
The problem is that your jsr's into the finally block occur from places that have a different number of
entries on the stack, and the verifier doesn't support that.

Either don't implement your finally with a jsr (inline the content directly), or clean up your stack prior to
the jsr so it's consistent with the other method exit points.

- Paul

-----Original Message-----
From: Vincent Marquez [mailto:[email protected]] 
Sent: Tuesday, December 14, 2004 11:53 AM
To: [email protected]
Subject: Try/Catch Errors

I'm not sure how active the list is, but I'll give it a shot.  I'm 
having trouble adding bytecode to methods wtih try/catch blocks.  I've 
been able to modify them correctly without try/catch blocks, but as soon 
as I uncomment them, I get the following error:

Exception in thread "main" java.lang.VerifyError: (class: Test, method: 
main signature: ([Ljava/lang/String;)V) Inconsistent stack height 0 != 2

I am calling setMaxStack() on the MethodGen instance.  I assume there is 
some simple trick that i'm missing?

Thanks in advance for any help.

--vince

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [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.