/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:879 */ protected soot.jimple.Stmt newLabel() { return soot.jimple.Jimple.v().newNopStmt(); } /**
/** * Constructs a NopStmt() grammar chunk. */ public NopStmt newNopStmt() { return Jimple.v().newNopStmt(); }
public NopStmt newNopStmt(NopStmt s) { return Jimple.v().newNopStmt(); }
public void outANopStatement(ANopStatement node) { Unit u = Jimple.v().newNopStmt(); mProductions.addLast(u); }
public soot.jimple.Stmt newLabel() { return soot.jimple.Jimple.v().newNopStmt(); }
public void jimplify(DexBody body) { markerUnit = Jimple.v().newNopStmt(); unit = markerUnit; body.add(markerUnit); body.addDeferredJimplification(this); }
/** * DoWhile Stmts Creation */ private void createDo2(polyglot.ast.Do doStmt) { soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); body.getUnits().add(noop1); // these are for break and continue endControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); condControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); // handle body createStmt(doStmt.body()); // handle cond soot.jimple.Stmt continueStmt = condControlNoop.pop(); body.getUnits().add(continueStmt); condControlNoop.push(continueStmt); if (labelMap != null && labelMap.containsKey(doStmt)) { body.getUnits().add(labelMap.get(doStmt)); } polyglot.ast.Expr condition = doStmt.cond(); createBranchingExpr(condition, noop1, true); body.getUnits().add((endControlNoop.pop())); condControlNoop.pop(); }
public void jimplify(DexBody body) { NopStmt nop = Jimple.v().newNopStmt(); setUnit(nop); addTags(nop); body.add(nop); }
soot.jimple.Stmt noop = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt(); labelBreakMap.put(label, noop2);
/** * While Stmts Creation */ private void createWhile2(polyglot.ast.While whileStmt) { soot.jimple.Stmt brchTgt = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt beginTgt = soot.jimple.Jimple.v().newNopStmt(); body.getUnits().add(beginTgt); // these are for break and continue endControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); condControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); // handle cond soot.jimple.Stmt continueStmt = condControlNoop.pop(); body.getUnits().add(continueStmt); condControlNoop.push(continueStmt); polyglot.ast.Expr condition = whileStmt.cond(); createBranchingExpr(condition, brchTgt, false); createStmt(whileStmt.body()); soot.jimple.GotoStmt gotoLoop = soot.jimple.Jimple.v().newGotoStmt(beginTgt); body.getUnits().add(gotoLoop); body.getUnits().add((endControlNoop.pop())); body.getUnits().add(brchTgt); condControlNoop.pop(); }
endControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); condControlNoop.push(soot.jimple.Jimple.v().newNopStmt()); createStmt((polyglot.ast.Stmt) initsIt.next()); soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt();
soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); body.getUnits().add(noop1); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt(); body.getUnits().add(noop2); soot.jimple.Stmt endNoop = soot.jimple.Jimple.v().newNopStmt(); while (it.hasNext()) { soot.jimple.Stmt noop3 = soot.jimple.Jimple.v().newNopStmt(); body.getUnits().add(noop3);
public void jimplify(DexBody body) { // check if target instruction has been jimplified if (getTargetInstruction(body).getUnit() != null) { body.add(gotoStatement()); return; } // set marker unit to swap real gotostmt with otherwise body.addDeferredJimplification(this); markerUnit = Jimple.v().newNopStmt(); addTags(markerUnit); unit = markerUnit; body.add(markerUnit); }
private void convertLabel(LabelNode ln) { if (!trapHandlers.containsKey(ln)) { return; } // We create a nop statement as a placeholder so that we can jump // somewhere from the real exception handler in case this is inline // code if (inlineExceptionLabels.contains(ln)) { if (!units.containsKey(ln)) { NopStmt nop = Jimple.v().newNopStmt(); setUnit(ln, nop); } return; } StackFrame frame = getFrame(ln); Operand[] out = frame.out(); Operand opr; if (out == null) { CaughtExceptionRef ref = Jimple.v().newCaughtExceptionRef(); Local stack = newStackLocal(); DefinitionStmt as = Jimple.v().newIdentityStmt(stack, ref); opr = new Operand(ln, ref); opr.stack = stack; frame.out(opr); setUnit(ln, as); } else { opr = out[0]; } push(opr); }
public void jimplify(DexBody body) { // check if target instruction has been jimplified if (getTargetInstruction(body).getUnit() != null) { IfStmt s = ifStatement(body); body.add(s); setUnit(s); } else { // set marker unit to swap real gotostmt with otherwise body.addDeferredJimplification(this); markerUnit = Jimple.v().newNopStmt(); unit = markerUnit; // beginUnit = markerUnit; // endUnit = markerUnit; // beginUnit = markerUnit; body.add(markerUnit); // Unit end = Jimple.v().newNopStmt(); // body.add(end); // endUnit = end; } }
/** * If Stmts Creation - only add line-number tags to if (the other stmts needing tags are created elsewhere */ private void createIf2(polyglot.ast.If ifExpr) { soot.jimple.NopStmt endTgt = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.NopStmt brchTgt = soot.jimple.Jimple.v().newNopStmt(); // handle cond polyglot.ast.Expr condition = ifExpr.cond(); createBranchingExpr(condition, brchTgt, false); // add consequence polyglot.ast.Stmt consequence = ifExpr.consequent(); createStmt(consequence); soot.jimple.Stmt goto1 = soot.jimple.Jimple.v().newGotoStmt(endTgt); body.getUnits().add(goto1); body.getUnits().add(brchTgt); // handle alternative polyglot.ast.Stmt alternative = ifExpr.alternative(); if (alternative != null) { createStmt(alternative); } body.getUnits().add(endTgt); }
private soot.Local handleCondBinExpr(soot.jimple.ConditionExpr condExpr) { soot.Local boolLocal = lg.generateLocal(soot.BooleanType.v()); soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); soot.Value newVal; newVal = reverseCondition(condExpr); newVal = handleDFLCond((soot.jimple.ConditionExpr) newVal); soot.jimple.Stmt ifStmt = soot.jimple.Jimple.v().newIfStmt(newVal, noop1); body.getUnits().add(ifStmt); body.getUnits().add(soot.jimple.Jimple.v().newAssignStmt(boolLocal, soot.jimple.IntConstant.v(1))); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt goto1 = soot.jimple.Jimple.v().newGotoStmt(noop2); body.getUnits().add(goto1); body.getUnits().add(noop1); body.getUnits().add(soot.jimple.Jimple.v().newAssignStmt(boolLocal, soot.jimple.IntConstant.v(0))); body.getUnits().add(noop2); return boolLocal; }
private soot.Local handleCondBinExpr(soot.jimple.ConditionExpr condExpr, boolean reverse) { soot.Local boolLocal = lg.generateLocal(soot.BooleanType.v()); soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); soot.Value newVal = condExpr; if (reverse) { newVal = reverseCondition(condExpr); } newVal = handleDFLCond((soot.jimple.ConditionExpr) newVal); soot.jimple.Stmt ifStmt = soot.jimple.Jimple.v().newIfStmt(newVal, noop1); body.getUnits().add(ifStmt); body.getUnits().add(soot.jimple.Jimple.v().newAssignStmt(boolLocal, soot.jimple.IntConstant.v(1))); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt goto1 = soot.jimple.Jimple.v().newGotoStmt(noop2); body.getUnits().add(goto1); body.getUnits().add(noop1); body.getUnits().add(soot.jimple.Jimple.v().newAssignStmt(boolLocal, soot.jimple.IntConstant.v(0))); body.getUnits().add(noop2); return boolLocal; }
soot.jimple.Stmt noop1 = soot.jimple.Jimple.v().newNopStmt(); polyglot.ast.Expr condition = condExpr.cond(); createBranchingExpr(condition, noop1, false); Util.addLnPosTags(conseqAssignStmt.getRightOpBox(), consequence.position()); soot.jimple.Stmt noop2 = soot.jimple.Jimple.v().newNopStmt(); soot.jimple.Stmt goto1 = soot.jimple.Jimple.v().newGotoStmt(noop2); body.getUnits().add(goto1);
firstStmt = body.getUnits().getPredOf(firstStmt); Stmt jumpTarget = Jimple.v().newNopStmt();