You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Steven Smith <st...@tonic.com> on 2004/01/20 17:27:04 UTC

RE: returnAddress and localVariable

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:francis.andre@easynet.fr]
Sent: Tuesday, January 20, 2004 9:47 AM
To: bcel-user@jakarta.apache.org
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: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org

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


Re: returnAddress and localVariable

Posted by Francis ANDRE <fr...@easynet.fr>.
Steven

Thank for the precision...but I am not speaking of Java...but of a JVM
bytecode method generated by the Cobol compiler I am building... I need to
store this returnAddress but BCEL forbids it as well as the Sun JDK
1.4.2...Thus, I was wondering if BCEL was rejecting the
declaration...because Sun JVM was rejecting it or for another reason!

Regards


----- Original Message -----
From: "Steven Smith" <st...@tonic.com>
To: "'BCEL Users List'" <bc...@jakarta.apache.org>
Sent: Tuesday, January 20, 2004 5:27 PM
Subject: RE: returnAddress and localVariable


> 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:francis.andre@easynet.fr]
> Sent: Tuesday, January 20, 2004 9:47 AM
> To: bcel-user@jakarta.apache.org
> 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: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org
>
>


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