jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Huntwork <...@huntwork.net>
Subject Re: Inclusive/exclusive exception ranges
Date Thu, 01 Apr 2004 15:18:57 GMT
yes it's true:
http://jakarta.apache.org/bcel/xref/org/apache/bcel/generic/CodeExceptionGen.html#110

the classfile api's generally reflect exactly what's in the class file 
(AFAICT), and the jvm spec says the end pc is exclusive:
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#1546

But the generic api's try to be generally useful, and giving a pointer 
to the instruction after the one that ends the range doesn't seem too 
useful (at least I've never been particularly interested in that 
instruction).

So the different api's make a certain amount of sense if you squint at 
them in exactly the right way...

Erik Corry wrote:
> Hi,
> 
> http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/generic/CodeExceptionGen.html#getEndPC()
says:
> 
> getEndPC
> 
> public InstructionHandle getEndPC()
> 
>     Returns:
>             end of handled region (inclusive)
> 
> 
> 
> But http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/classfile/CodeException.html#getEndPC()
says:
> 
> getEndPC
> 
> public final int getEndPC()
> 
>     Returns:
>             Exclusive end index of the region where the handler is active.
> 
> 
> 
> Is this really right?  The one method gives you the exclusive and
> the other gives you the inclusive end address?
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message