use of soot.dexpler.tags.ObjectOpTag in project soot by Sable.
the class AputInstruction method jimplify.
@Override
public void jimplify(DexBody body) {
if (!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: " + instruction.getClass());
Instruction23x aPutInstr = (Instruction23x) instruction;
int source = aPutInstr.getRegisterA();
Local arrayBase = body.getRegisterLocal(aPutInstr.getRegisterB());
Local index = body.getRegisterLocal(aPutInstr.getRegisterC());
ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index);
Local sourceValue = body.getRegisterLocal(source);
AssignStmt assign = getAssignStmt(body, sourceValue, arrayRef);
if (aPutInstr.getOpcode() == Opcode.APUT_OBJECT)
assign.addTag(new ObjectOpTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true);
}
}
use of soot.dexpler.tags.ObjectOpTag in project soot by Sable.
the class AgetInstruction method jimplify.
@Override
public void jimplify(DexBody body) throws InvalidDalvikBytecodeException {
if (!(instruction instanceof Instruction23x))
throw new IllegalArgumentException("Expected Instruction23x but got: " + instruction.getClass());
Instruction23x aGetInstr = (Instruction23x) instruction;
int dest = aGetInstr.getRegisterA();
Local arrayBase = body.getRegisterLocal(aGetInstr.getRegisterB());
Local index = body.getRegisterLocal(aGetInstr.getRegisterC());
ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index);
Local l = body.getRegisterLocal(dest);
AssignStmt assign = Jimple.v().newAssignStmt(l, arrayRef);
if (aGetInstr.getOpcode() == Opcode.AGET_OBJECT)
assign.addTag(new ObjectOpTag());
setUnit(assign);
addTags(assign);
body.add(assign);
if (IDalvikTyper.ENABLE_DVKTYPER) {
DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox());
DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true);
}
}
Aggregations