[Soot-list] Jimple jump to nopStmt

Pedro Louro pedrolour at gmail.com
Wed Apr 6 06:38:55 EDT 2011


Hello!

I´m instrumenting code and I need to insert a jump to a nop Statment.
The code is something like this:

Stmt nop = Jimple.v().newNopStmt();
units.insertBefore(nop, target);
Stmt jump = Jimple.v().newGotoStmt(nop);
units.insertBefore(jump, units.getPredOf(target));

But when I see what is really inserted I get this:
goto [?= (branch)]

when I should get this
goto [?= nop]

and because that it just explodes with this error:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at edu.hkust.leap.Main.run(Main.java:33)
	at edu.hkust.leap.Main.transform(Main.java:23)
	at edu.hkust.leap.Main.main(Main.java:17)
Caused by: java.lang.StackOverflowError
	at soot.baf.internal.AbstractBranchInst.toString(AbstractBranchInst.java:53)
	at java.lang.String.valueOf(Unknown Source)
	at java.lang.StringBuilder.append(Unknown Source)
	at soot.baf.internal.AbstractBranchInst.toString(AbstractBranchInst.java:53)
	at java.lang.String.valueOf(Unknown Source)
	at java.lang.StringBuilder.append(Unknown Source)
        at soot.baf.internal.AbstractBranchInst.toString(AbstractBranchInst.java:53)
	at java.lang.String.valueOf(Unknown Source)
	at java.lang.StringBuilder.append(Unknown Source)
(...)

If I set the goto to another Stmt it works fine, but not with Nop´s.
Is there any limitation with this ?

Thanks for the continuous help!

Best Regards
Pedro Louro


More information about the Soot-list mailing list