public IfStmt newIfStmt(IfStmt s) { return new GIfStmt(s.getCondition(), s.getTarget()); }
public soot.jimple.IfStmt newIfStmt(Value op, Unit target, ASTNode location) { soot.jimple.IfStmt stmt = Jimple.v().newIfStmt(op, target); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getConditionBox().addTag(tag); return stmt; }
if (s instanceof IfStmt) { IfStmt ifStmt = (IfStmt) s; Value cond = ifStmt.getCondition(); Constant constant = SEvaluator.getFuzzyConstantValueOf(cond, localToConstant); GotoStmt gotoStmt = Jimple.v().newGotoStmt(ifStmt.getTargetBox()); stmtToReplacement.put(ifStmt, gotoStmt);
private boolean sameCondLocal(Stmt s1, Stmt s2) { AssignStmt as1 = (AssignStmt) s1; IfStmt is2 = (IfStmt) s2; if (is2.getCondition() instanceof BinopExpr) { BinopExpr bs2 = (BinopExpr) is2.getCondition(); if (as1.getLeftOp().equals(bs2.getOp1())) { return true; } } return false; } }
if (cycle_body.contains(asg.get_AugStmt(condition.getTarget())) == false) { condition.setCondition(ConditionFlipper.flip((ConditionExpr) condition.getCondition()));
units.insertAfter(jgs, u); JGotoStmt jumper = new JGotoStmt((Unit) ifs.getTarget()); units.insertAfter(jumper, jgs); ifs.setTarget((Unit) jumper); javafy(((IfStmt) s).getConditionBox()); } else if (s instanceof ThrowStmt) { javafy(((ThrowStmt) s).getOpBox());
/** * Creates a new jimple IfStmt and adds all tags from createdFrom to this * statement. * * @param condition * @param target * @param createdFrom * @return */ protected Unit ifStmtFor(Value condition, Unit target, Host createdFrom) { IfStmt stmt = Jimple.v().newIfStmt(condition, target); stmt.addAllTagsOf(createdFrom); return stmt; }
@Override public void caseIfStmt(IfStmt s) { result = result.add(mightThrow(s.getCondition())); }
AugmentedStmt succIf = asg.get_AugStmt(ifs.getTarget()), succElse = (AugmentedStmt) as.bsuccs.get(0);
ifstmt.setTarget(u);
@Override public void caseIfStmt(IfStmt stmt) { Stmt target = stmt.getTarget(); exprV.setOrigStmt(stmt); exprV.setTargetForOffset(target); stmt.getCondition().apply(exprV); }
public void caseIfStmt(IfStmt stmt) { this.handleBinopExpr((BinopExpr) stmt.getCondition(), stmt, BooleanType.v()); }
private void transformBody(Body b, Stmt next) { // change target of stmts 0 and 1 to target of stmt 5 // remove stmts 2, 3, 4, 5 Stmt newTarget = null; Stmt oldTarget = null; if (sameGoto) { newTarget = ((IfStmt) stmtSeq[5]).getTarget(); } else { newTarget = next; oldTarget = ((IfStmt) stmtSeq[5]).getTarget(); } ((IfStmt) stmtSeq[0]).setTarget(newTarget); ((IfStmt) stmtSeq[1]).setTarget(newTarget); for (int i = 2; i <= 5; i++) { b.getUnits().remove(stmtSeq[i]); } if (!sameGoto) { b.getUnits().insertAfter(Jimple.v().newGotoStmt(oldTarget), stmtSeq[1]); } }
/** * Eliminates all loops of length 0 (if a goto <if a>) * * @param body The body from which to eliminate the self-loops */ protected void eliminateSelfLoops(Body body) { // Get rid of self-loops for (Iterator<Unit> unitIt = body.getUnits().iterator(); unitIt.hasNext();) { Unit u = unitIt.next(); if (u instanceof IfStmt) { IfStmt ifStmt = (IfStmt) u; if (ifStmt.getTarget() == ifStmt) unitIt.remove(); } } }
units.insertBefore(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(classCacher.makeRef()), l), target); ifStmt.setTarget(target); return l;
body.getUnits().add(ifStmt); Util.addLnPosTags(ifStmt.getConditionBox(), assertStmt.cond().position()); Util.addLnPosTags(ifStmt, assertStmt.position());
public void caseIfStmt(IfStmt stmt) { String varName = printValueAssignment(stmt.getCondition(), "condition"); Unit target = stmt.getTarget(); vtp.suggestVariableName("target"); String targetName = vtp.getLastAssignedVarName(); p.println("Unit " + targetName + "=" + nameOfJumpTarget(target) + ";"); printStmt(stmt, varName, targetName); }