[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inserting instructions with Baf



Chris Pickett <chris.pickett@mail.mcgill.ca> wrote:
> I can get it to work in Jimple, except that sometimes there are 
> intervening bytecodes:
> 
> INVOKESTATIC
> possible intervening bytecodes
> INVOKE<X>

Correct me if I'm wrong, but these intervening bytecodes are needed to
load operands on the stack before making the function call.

> I tried using Baf, since it works at the instruction level, but I can't 
> seem to get a (Patching)Chain of Units that can be cast to Inst ... it 
> only works for Stmt.  Another alternative would be some trick in Jimple 
> that always put the INVOKESTATIC right before the INVOKE<X>, but I can't 
> think of a way to do it.

This works fine for me and results in no intervening bytecodes.  

Make sure you are adding the transformation to a proper Baf phase, not
to "jtp" which is specific to Jimple.  I added it to "bop" which I then
enabled from the command line with "-p bop on".

Cheers,
Navin.