Search code examples
javasoot

define integer local with soot library


I want to define Local with Integer type in soot library.I try to define local with this command

Local intLocal=Jimple.v().newLocal("intLocal",RefType.v("java.lang.Integer"));
IdentityStmt IST=Jimple.v().newIdentityStmt(intLocal,Jimple.v().newStaticFieldRef(Scene.v().getField("<java.lang.integer>").makeRef()));

but I got error

[Thread-3] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: oops <java.lang.integer>

can anyone explain how I can define local with integer type?


Solution

  • Your getField call is broken. You are passing an invalid reference. And you should be using an AssignStmt, not an IdentityStmt.