use of soot.Unit in project soot by Sable.
the class Walker method outANopStatement.
public void outANopStatement(ANopStatement node) {
Unit u = Jimple.v().newNopStmt();
mProductions.addLast(u);
}
use of soot.Unit in project soot by Sable.
the class Walker method outAEntermonitorStatement.
public void outAEntermonitorStatement(AEntermonitorStatement node) {
Value op = (Value) mProductions.removeLast();
Unit u = Jimple.v().newEnterMonitorStmt(op);
mProductions.addLast(u);
}
use of soot.Unit in project soot by Sable.
the class Walker method outALookupswitchStatement.
public void outALookupswitchStatement(ALookupswitchStatement node) {
List<IntConstant> lookupValues = new ArrayList<IntConstant>();
List<UnitBox> targets = new ArrayList<UnitBox>();
UnitBox defaultTarget = null;
if (node.getCaseStmt() != null) {
int size = node.getCaseStmt().size();
for (int i = 0; i < size; i++) {
Object valueTargetPair = mProductions.removeLast();
if (valueTargetPair instanceof UnitBox) {
if (defaultTarget != null)
throw new RuntimeException("error: can't ;have more than 1 default stmt");
defaultTarget = (UnitBox) valueTargetPair;
} else {
Object[] pair = (Object[]) valueTargetPair;
lookupValues.add(0, (IntConstant) pair[0]);
targets.add(0, (UnitBox) pair[1]);
}
}
} else {
throw new RuntimeException("error: switch stmt has no case stmts");
}
Value key = (Value) mProductions.removeLast();
Unit switchStmt = Jimple.v().newLookupSwitchStmt(key, lookupValues, targets, defaultTarget);
mProductions.addLast(switchStmt);
}
use of soot.Unit in project soot by Sable.
the class Walker method outAGotoStatement.
public void outAGotoStatement(AGotoStatement node) {
String targetLabel = (String) mProductions.removeLast();
UnitBox box = Jimple.v().newStmtBox(null);
Unit branch = Jimple.v().newGotoStmt(box);
addBoxToPatch(targetLabel, box);
mProductions.addLast(branch);
}
use of soot.Unit in project soot by Sable.
the class Walker method outAInvokeStatement.
public void outAInvokeStatement(AInvokeStatement node) {
Value op = (Value) mProductions.removeLast();
Unit u = Jimple.v().newInvokeStmt(op);
mProductions.addLast(u);
}
Aggregations