[Soot-list] How to pass an object of MyClass in newStaticInvokeExpr

Jan Peter Stotz jan-peter.stotz at sit.fraunhofer.de
Thu Mar 7 13:40:57 EST 2019


Hi Dhriti

> But what if I want to pass an object of MyClass or
> java.util.ArrayList?

You are thinking in Java code, however Jimple code is much simpler. In 
Java you can create an "one-liner" like this:

my.package.myClass.loopStart(new MyClass());

In Jimple this requires always multiple commands:

1. load MyClass to a local variable "c"
2. create new instance of MyClass (using "c") and store in in a local 
variable "o"
3. invoke my.package.myClass.loopStart with ["o"] as parameters

In Jimple you have to load everything in "Local" variables. Then you can 
use it.

If you are unsure how to do something in Jimple just write Java code, 
compile it and use Soot to convert it to Jimple. Then you can use it as 
a template.

Jan


More information about the Soot-list mailing list