public void outAReturnStatement(AReturnStatement node) { Immediate v; Stmt s = null; if (node.getImmediate() != null) { v = (Immediate) mProductions.removeLast(); s = Jimple.v().newReturnStmt(v); } else { s = Jimple.v().newReturnVoidStmt(); } mProductions.addLast(s); }
public soot.jimple.ReturnStmt newReturnStmt(Value op, ASTNode location) { soot.jimple.ReturnStmt stmt = Jimple.v().newReturnStmt(op); soot.tagkit.Tag tag = getTag(op); if(tag != null) stmt.getOpBox().addTag(tag); return stmt; }
@Override public void jimplify(DexBody body) { Instruction11x returnInstruction = (Instruction11x) this.instruction; Local l = body.getRegisterLocal(returnInstruction.getRegisterA()); ReturnStmt returnStmt = Jimple.v().newReturnStmt(l); setUnit(returnStmt); addTags(returnStmt); body.add(returnStmt); if (IDalvikTyper.ENABLE_DVKTYPER) { // DalvikTyper.v().addConstraint(returnStmt.getOpBox(), new // ImmediateBox(Jimple.body.getBody().getMethod().getReturnType())); DalvikTyper.v().setType(returnStmt.getOpBox(), body.getBody().getMethod().getReturnType(), true); } } }
sootLocal = handleCondBinExpr((soot.jimple.ConditionExpr) sootLocal); soot.jimple.ReturnStmt retStmtLocal = soot.jimple.Jimple.v().newReturnStmt(sootLocal); body.getUnits().add(retStmtLocal); Util.addLnPosTags(retStmtLocal.getOpBox(), expr.position());
private void convertReturnInsn(InsnNode insn) { int op = insn.getOpcode(); boolean dword = op == LRETURN || op == DRETURN; StackFrame frame = getFrame(insn); if (!units.containsKey(insn)) { Operand val = dword ? popImmediateDual() : popImmediate(); ReturnStmt ret = Jimple.v().newReturnStmt(val.stackOrValue()); val.addBox(ret.getOpBox()); frame.in(val); frame.boxes(ret.getOpBox()); setUnit(insn, ret); } else { frame.mergeIn(dword ? popDual() : pop()); } }
locals.add(assign); units.add(Jimple.v().newAssignStmt(assign, ie)); units.add(Jimple.v().newReturnStmt(assign));
s = Jimple.v().newAssignStmt(resultLocal, accExpr); accStmts.add(s); accStmts.add(Jimple.v().newReturnStmt(resultLocal));
private void getBootstrapBody(SootClass tclass, JimpleBody jb) { PatchingChain<Unit> us = jb.getUnits(); LocalGenerator lc = new LocalGenerator(jb); List<Value> capValues = new ArrayList<Value>(); List<Type> capTypes = new ArrayList<Type>(); int i = 0; for (SootField capField : capFields) { Type type = capField.getType(); capTypes.add(type); Local p = lc.generateLocal(type); ParameterRef pref = Jimple.v().newParameterRef(type, i); us.add(Jimple.v().newIdentityStmt(p, pref)); capValues.add(p); i++; } Local l = lc.generateLocal(tclass.getType()); Value val = Jimple.v().newNewExpr(tclass.getType()); us.add(Jimple.v().newAssignStmt(l, val)); us.add(Jimple.v() .newInvokeStmt(Jimple.v().newSpecialInvokeExpr(l, Scene.v().makeConstructorRef(tclass, capTypes), capValues))); us.add(Jimple.v().newReturnStmt(l)); }
soot.jimple.Stmt retStmt = soot.jimple.Jimple.v().newReturnStmt(fieldLocal); body.getUnits().add(retStmt);
soot.jimple.Stmt retStmt = soot.jimple.Jimple.v().newReturnStmt(assignLocal); body.getUnits().add(retStmt);
retStmt = soot.jimple.Jimple.v().newReturnStmt(returnLocal); } else { retStmt = soot.jimple.Jimple.v().newReturnVoidStmt();
units.add(Jimple.v().newReturnVoidStmt()); } else if (returnType instanceof PrimType) { units.add(Jimple.v().newReturnStmt(IntConstant.v(0))); } else { units.add(Jimple.v().newReturnStmt(NullConstant.v())); units.add(Jimple.v().newReturnStmt(loc));
accStmts.add(Jimple.v().newReturnStmt(l));
jBody.getUnits().add(Jimple.v().newReturnStmt(l));
soot.jimple.Stmt retStmt = soot.jimple.Jimple.v().newReturnStmt(invokeLocal); classBody.getUnits().add(retStmt);
soot.jimple.Stmt retStmt = soot.jimple.Jimple.v().newReturnStmt(invokeLocal); classBody.getUnits().add(retStmt);
/** * Invocation of target implementation method. * * @param jb * @param us * @param args */ private void invokeImplMethod(JimpleBody jb, PatchingChain<Unit> us, LocalGenerator lc, List<Local> args) { Value value = _invokeImplMethod(jb, us, lc, args); if (value instanceof InvokeExpr && soot.VoidType.v().equals(implMethod.getMethodRef().returnType())) { // implementation method is void us.add(Jimple.v().newInvokeStmt(value)); us.add(Jimple.v().newReturnVoidStmt()); } else if (soot.VoidType.v().equals(implMethodType.getReturnType())) { // dispatch method is void us.add(Jimple.v().newInvokeStmt(value)); us.add(Jimple.v().newReturnVoidStmt()); } else { // neither is void, must pass through return value Local ret = lc.generateLocal(value.getType()); us.add(Jimple.v().newAssignStmt(ret, value)); // adapt return value Local retAdapted = adapt(ret, implMethodType.getReturnType(), jb, us, lc); us.add(Jimple.v().newReturnStmt(retAdapted)); } }
newUnits.add(Jimple.v().newReturnStmt(retLocal));
units.add(Jimple.v().newReturnStmt(l_r2));
case ByteCode.FRETURN: case ByteCode.ARETURN: stmt = Jimple.v().newReturnStmt(Util.v().getLocalForStackOp(listBody, typeStack, typeStack.topIndex())); break;