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 Jens Danker <da...@rbg.informatik.tu-darmstadt.de> on 2003/04/21 12:32:27 UTC

JSR / RET

Hi, 

I have a problem with the JSR / RET combination. How have to look the code to store the return address pushed by the JSR instruction?

My NOT working code looks like this:

        // Return address type
        Type returnType = ReturnaddressType.NO_TARGET;

        // Create local variable
        LocalVariableGen lvRetPC = mg.addLocalVariable("RetPC", returnType, null, null);

        // Store jsr return program counter value and set valid from here
        InstructionHandle store = il.append(factory.createStore(returnType, lvRetPC.getIndex()));

        ...

        il.append(new RET(lvRetPC.getIndex()) ;
           

When running this code I got an exception which says that BCEL can't handle the store, because it don't know the return address type.

What's wrong?

Jens



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