Generally speaking, because it's not possible to declare a local variable in
your Java program as a type that is the return address, as in:

        int x;
        String y;
        ReturnAddress z;        // not possible  

As best I remember, ReturnAddressType can only be the type of a local
variable inside a JSR "subroutine".  It is typically stored onto the stack
as the first instruction in the subroutine (invoked via JSR/JSR_W), so that
a RET instruction will know where to return.  

-----Original Message-----
From: Francis ANDRE [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 9:47 AM
To: [EMAIL PROTECTED]
Subject: [Q]: returnAddress and localVariable


Hi BCEL users


Here a simple question: Why the BCEL is rejecting the declaration of a local
variable of  type Returnaddress ???

java.lang.IllegalArgumentException: Can not use <return address> as type for
local variable
at org.apache.bcel.generic.MethodGen.addLocalVariable(MethodGen.java:352)
at org.apache.bcel.generic.MethodGen.addLocalVariable(MethodGen.java:375)
at com.pac.cob.cmp.JVMCodeGeneration.generate(JVMCodeGeneration.java:144)


Regards


FA


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to