soot.jimple.infoflow.util.SootUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soot-infoflow Show documentation
Show all versions of soot-infoflow Show documentation
Soot extending data flow tracking components for Java
The newest version!
package soot.jimple.infoflow.util;
import java.util.ArrayList;
import java.util.List;
import soot.Unit;
import soot.Value;
import soot.ValueBox;
import soot.jimple.InvokeExpr;
/**
* Class containing various utility methods for dealing with Soot
*
* @author Steven Arzt
*
*/
public class SootUtils {
public static List getUseAndDefValues(Unit u) {
List valueList = new ArrayList<>();
for (ValueBox vb : u.getUseAndDefBoxes()) {
Value val = vb.getValue();
if (val instanceof InvokeExpr) {
InvokeExpr iexpr = (InvokeExpr) val;
for (ValueBox invBox : iexpr.getUseBoxes())
valueList.add(invBox.getValue());
} else
valueList.add(val);
}
return valueList;
}
}