private void printBinaryExpr(BinopExpr v) { String className = v.getClass().getSimpleName(); if (className.charAt(0) == 'J') { className = className.substring(1); } String oldName = varName; Value left = v.getOp1(); String v1 = printValueAssignment(left, "left"); Value right = v.getOp2(); String v2 = printValueAssignment(right, "right"); p.println("Value " + oldName + " = Jimple.v().new" + className + "(" + v1 + "," + v2 + ");"); varName = oldName; }
@Override public void caseIfStmt(IfStmt stmt) { // add constraint Value c = stmt.getCondition(); if (c instanceof BinopExpr) { BinopExpr bo = (BinopExpr) c; Value op1 = bo.getOp1(); Value op2 = bo.getOp2(); if (op1 instanceof Local && op2 instanceof Local) { DalvikTyper.v().addConstraint(bo.getOp1Box(), bo.getOp2Box()); } } }
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; } }
public void handleBinop(BinopExpr binop, boolean ordered) { Node nop1 = fetchNode(binop.getOp1()); Node nop2 = fetchNode(binop.getOp2()); List<Node> children = new ArrayList<Node>(); children.add(nop1); children.add(nop2); setResult(new Node(binop, ordered, children)); }
private void caseBinopExpr(BinopExpr expr) { result = result.add(mightThrow(expr.getOp1())); result = result.add(mightThrow(expr.getOp2())); }
System.out.println("Binop expr" + binop); Value leftOp = binop.getOp1(); Value rightOp = binop.getOp2();
Value op1 = ((BinopExpr) right).getOp1(); Value op2 = ((BinopExpr) right).getOp2();
} else if (rhs instanceof BinopExpr) { BinopExpr be = (BinopExpr) rhs; Value lop = be.getOp1(), rop = be.getOp2(); if (lop instanceof Local) { this.addDepend((Local) lop, assignmentIdx);
final Value op1 = binExpr.getOp1(); final Value op2 = binExpr.getOp2();
if (c instanceof BinopExpr) { BinopExpr be = (BinopExpr) c; Value op1 = be.getOp1(); Value op2 = be.getOp2(); if (op1 instanceof UntypedConstant || op2 instanceof UntypedConstant) {
if (isConstZero(aer.getOp1())) { assignStmt.setRightOp(aer.getOp2()); } else if (isConstZero(aer.getOp2())) { assignStmt.setRightOp(aer.getOp1()); BinopExpr aer = (BinopExpr) assignStmt.getRightOp(); if (isConstZero(aer.getOp2())) { assignStmt.setRightOp(aer.getOp1()); if (isConstZero(aer.getOp1())) { assignStmt.setRightOp(getZeroConst(assignStmt.getLeftOp().getType())); } else if (isConstZero(aer.getOp2())) {
private Parity getParity(Map<Value, Parity> in, Value val) { Parity resVal1 = getParity(in, ((BinopExpr) val).getOp1()); Parity resVal2 = getParity(in, ((BinopExpr) val).getOp2()); Parity resVal1 = getParity(in, ((BinopExpr) val).getOp1()); Parity resVal2 = getParity(in, ((BinopExpr) val).getOp2()); if (resVal1.equals(TOP) | resVal2.equals(TOP)) {
Local l = (Local) lvalue; BinopExpr expr = (BinopExpr) rvalue; Value op1 = expr.getOp1(); Value op2 = expr.getOp2();
Value lv = expr.getOp1(); Value rv = expr.getOp2();
Value lv = expr.getOp1(); Value rv = expr.getOp2();
Value lv = expr.getOp1(); Value rv = expr.getOp2();
Value lv = expr.getOp1(); Value rv = expr.getOp2();
private void handleBinopExpr(BinopExpr be, Stmt stmt, Type tlhs) { Value opl = be.getOp1(), opr = be.getOp2(); Type tl = AugEvalFunction.eval_(this.tg, opl, stmt, this.jb), tr = AugEvalFunction.eval_(this.tg, opr, stmt, this.jb); if (be instanceof AddExpr || be instanceof SubExpr || be instanceof MulExpr || be instanceof DivExpr || be instanceof RemExpr || be instanceof GeExpr || be instanceof GtExpr || be instanceof LeExpr || be instanceof LtExpr || be instanceof ShlExpr || be instanceof ShrExpr || be instanceof UshrExpr) { if (tlhs instanceof IntegerType) { be.setOp1(this.uv.visit(opl, IntType.v(), stmt)); be.setOp2(this.uv.visit(opr, IntType.v(), stmt)); } } else if (be instanceof CmpExpr || be instanceof CmpgExpr || be instanceof CmplExpr) { // No checks in the original assigner } else if (be instanceof AndExpr || be instanceof OrExpr || be instanceof XorExpr) { be.setOp1(this.uv.visit(opl, tlhs, stmt)); be.setOp2(this.uv.visit(opr, tlhs, stmt)); } else if (be instanceof EqExpr || be instanceof NeExpr) { if (tl instanceof BooleanType && tr instanceof BooleanType) { } else if (tl instanceof Integer1Type || tr instanceof Integer1Type) { } else if (tl instanceof IntegerType) { be.setOp1(this.uv.visit(opl, IntType.v(), stmt)); be.setOp2(this.uv.visit(opr, IntType.v(), stmt)); } } }
BinopExpr be = (BinopExpr) e; walk_value(a, be.getOp1()); walk_value(a, be.getOp2()); a.analyseBinopExpr(be);