Re: Possible bug in InstructionFinder class

"Dave Brosius" <[email protected]> Sat, 23 Jun 2007 13:56:40 -0500
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <003101c7b5c8$3cd299b0$6501a8c0@MeBigFatGuy>
This was reported here:
http://issues.apache.org/bugzilla/show_bug.cgi?id=40044

and fixed in svn head.


----- Original Message ----- 
From: "Nicholson, Jonathan O H" <[email protected]>
To: "BCEL Users List" <[email protected]>
Sent: Friday, June 22, 2007 7:13 PM
Subject: Possible bug in InstructionFinder class


Hi there,

Been playing with the InstructionFinder class, and it seems that it always 
returns an extra instruction handler in the resulting array, causing an 
exception if the last instruction being looked for is a return.

I've looked in the source (downloaded today) and found the problem, there is 
a line in search(String, InstructionHandle, CodeConstraint) that reads:
int lenExpr = (endExpr - startExpr) + 1;

Not sure why that 1 is there... removing it makes the class work correctly.

Hope this helps others who've had similar issues
Mac

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]