Search in sources :

Example 1 with UntypedConstant

use of soot.dexpler.typing.UntypedConstant in project soot by Sable.

the class ConstInstruction method jimplify.

@Override
public void jimplify(DexBody body) {
    int dest = ((OneRegisterInstruction) instruction).getRegisterA();
    Constant cst = getConstant(dest, body);
    AssignStmt assign = Jimple.v().newAssignStmt(body.getRegisterLocal(dest), cst);
    setUnit(assign);
    addTags(assign);
    body.add(assign);
    if (IDalvikTyper.ENABLE_DVKTYPER) {
        if (cst instanceof UntypedConstant) {
            DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
        } else {
            DalvikTyper.v().setType(assign.getLeftOpBox(), cst.getType(), false);
        }
    }
}
Also used : OneRegisterInstruction(org.jf.dexlib2.iface.instruction.OneRegisterInstruction) IntConstant(soot.jimple.IntConstant) UntypedIntOrFloatConstant(soot.dexpler.typing.UntypedIntOrFloatConstant) UntypedConstant(soot.dexpler.typing.UntypedConstant) Constant(soot.jimple.Constant) LongConstant(soot.jimple.LongConstant) UntypedLongOrDoubleConstant(soot.dexpler.typing.UntypedLongOrDoubleConstant) AssignStmt(soot.jimple.AssignStmt) UntypedConstant(soot.dexpler.typing.UntypedConstant)

Aggregations

OneRegisterInstruction (org.jf.dexlib2.iface.instruction.OneRegisterInstruction)1 UntypedConstant (soot.dexpler.typing.UntypedConstant)1 UntypedIntOrFloatConstant (soot.dexpler.typing.UntypedIntOrFloatConstant)1 UntypedLongOrDoubleConstant (soot.dexpler.typing.UntypedLongOrDoubleConstant)1 AssignStmt (soot.jimple.AssignStmt)1 Constant (soot.jimple.Constant)1 IntConstant (soot.jimple.IntConstant)1 LongConstant (soot.jimple.LongConstant)1