private void javafy_cast_expr(ValueBox vb) { CastExpr ce = (CastExpr) vb.getValue(); javafy(ce.getOpBox()); }
public soot.jimple.CastExpr newCastExpr(Value op1, Type t, ASTNode location) { soot.jimple.CastExpr expr = Jimple.v().newCastExpr(op1, t); createTag(expr, location); soot.tagkit.Tag op1tag = getTag(op1); if(op1tag != null) expr.getOpBox().addTag(op1tag); return expr; }
public void caseCastExpr(CastExpr ce) { inCastExpr(ce); Type type = ce.getCastType(); caseType(type); caseExprOrRefValueBox(ce.getOpBox()); // Value op = ce.getOp(); // decideCaseExprOrRef(op); outCastExpr(ce); }
OpBox = ((CastExpr) right).getOpBox(); } else { rightType = ds.getLeftOp().getType();
/** * Cast Expression Creation */ private soot.Value getCastLocal(polyglot.ast.Cast castExpr) { // if its already the right type if (castExpr.expr().type().equals(castExpr.type()) || (castExpr.type().isClass() && Util.getSootType(castExpr.type()).toString().equals("java.lang.Object"))) { return base().createAggressiveExpr(castExpr.expr(), false, false); } soot.Value val; val = base().createAggressiveExpr(castExpr.expr(), false, false); soot.Type type = Util.getSootType(castExpr.type()); soot.jimple.CastExpr cast = soot.jimple.Jimple.v().newCastExpr(val, type); Util.addLnPosTags(cast.getOpBox(), castExpr.expr().position()); soot.Local retLocal = lg.generateLocal(cast.getCastType()); soot.jimple.Stmt castAssign = soot.jimple.Jimple.v().newAssignStmt(retLocal, cast); body.getUnits().add(castAssign); Util.addLnPosTags(castAssign, castExpr.position()); return retLocal; }
DalvikTyper.v().setType(ce.getOpBox(), IntType.v(), false); return; } else if (t instanceof FloatOpTag) { DalvikTyper.v().setType(ce.getOpBox(), FloatType.v(), false); return; } else if (t instanceof DoubleOpTag) { DalvikTyper.v().setType(ce.getOpBox(), DoubleType.v(), false); return; } else if (t instanceof LongOpTag) { DalvikTyper.v().setType(ce.getOpBox(), LongType.v(), false); return; DalvikTyper.v().setType(ce.getOpBox(), RefType.v("java.lang.Object"), false);
} else if (op == CHECKCAST) { CastExpr expr = Jimple.v().newCastExpr(v1, t); vb = expr.getOpBox(); val = expr; } else if (op == INSTANCEOF) {