I believe it's rejecting it because it because it's not legal in terms of the JVM spec.
Good luck! -----Original Message----- From: Francis ANDRE [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 11:21 AM To: BCEL Users List Subject: Re: returnAddress and localVariable 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" <[EMAIL PROTECTED]> To: "'BCEL Users List'" <[EMAIL PROTECTED]> 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:[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] > > --------------------------------------------------------------------- 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]
