public void caseGotoStmt(GotoStmt s) { GotoStmt newStmt = (GotoStmt) (oldToNew.get(s)); newStmt.setTarget(oldToNew.get(newStmt.getTarget())); }
private Stmt getFinalTarget(Stmt stmt) { Stmt finalTarget = null, target; // if not a goto, this is the final target if (!(stmt instanceof GotoStmt)) { return stmt; } // first map this statement to itself, so we can detect cycles stmtMap.put(stmt, stmt); target = (Stmt) ((GotoStmt) stmt).getTarget(); // check if target is in statement map if (stmtMap.containsKey(target)) { // see if it maps to itself finalTarget = stmtMap.get(target); if (finalTarget == target) { // this is part of a cycle finalTarget = null; } } else { finalTarget = getFinalTarget(target); } stmtMap.put(stmt, finalTarget); return finalTarget; } // getFinalTarget
@Override public void caseGotoStmt(GotoStmt stmt) { Stmt target = (Stmt) stmt.getTarget(); addInsn(buildGotoInsn(target), stmt); }
@Override protected void internalTransform(Body b, String phaseName, Map<String, String> options) { for (Iterator<Unit> unitIt = b.getUnits().snapshotIterator(); unitIt.hasNext();) { Unit u = unitIt.next(); if (u instanceof GotoStmt) { GotoStmt stmt = (GotoStmt) u; while (stmt.getTarget() instanceof GotoStmt) { GotoStmt nextTarget = (GotoStmt) stmt.getTarget(); stmt.setTarget(nextTarget.getTarget()); } } else if (u instanceof IfStmt) { IfStmt stmt = (IfStmt) u; while (stmt.getTarget() instanceof GotoStmt) { GotoStmt nextTarget = (GotoStmt) stmt.getTarget(); stmt.setTarget(nextTarget.getTarget()); } } } }
public GotoStmt newGotoStmt(GotoStmt s) { return Jimple.v().newGotoStmt(s.getTarget()); }
s = (Stmt) ((GotoStmt) s).getTarget();
private boolean checkProtectionArea(AugmentedStmt as, DefinitionStmt s) { IterableSet esuccs = new IterableSet(); esuccs.addAll(as.csuccs); esuccs.removeAll(as.bsuccs); // esuccs contains the exception sucessors of as // System.out.println("ESUCCS are:"+esuccs); Iterator it = esuccs.iterator(); while (it.hasNext()) { // going through each exception sucessor AugmentedStmt tempas = (AugmentedStmt) it.next(); Stmt temps = tempas.get_Stmt(); if (temps instanceof GotoStmt) { Unit target = ((GotoStmt) temps).getTarget(); if (target != s) { // System.out.println("DID NOT Match indirectly"); return false; } else { // System.out.println("Matched indirectly"); } } else { if (temps != s) { // System.out.println("DID NOT Match directly"); return false; } else { // System.out.println("Matched directly"); } } } return true; }
public void caseGotoStmt(GotoStmt stmt) { Unit target = stmt.getTarget(); vtp.suggestVariableName("target"); String targetName = vtp.getLastAssignedVarName(); p.println("Unit " + targetName + "=" + nameOfJumpTarget(target) + ";"); printStmt(stmt, targetName); }
} else if (nextUnit instanceof GotoStmt) { tn.end = new Pair(nextUnit, stmt); // <end stmt, exitmonitor stmt> tn.after = (Stmt) ((GotoStmt) nextUnit).getTarget(); } else if (nextUnit instanceof ThrowStmt) { tn.exceptionalEnd = new Pair(nextUnit, stmt);
if (stmt instanceof GotoStmt) { target = (Stmt) ((GotoStmt) stmt).getTarget();
if (isTarget((Stmt) ((GotoStmt) stmtSeq[3]).getTarget(), s) && sameCondLocal(stmtSeq[4], s) && (((IfStmt) s).getCondition() instanceof EqExpr)) { stmtSeq[pos] = s; return true; } else if (isTarget((Stmt) ((GotoStmt) stmtSeq[3]).getTarget(), s) && sameCondLocal(stmtSeq[4], s)) { stmtSeq[pos] = s; sameGoto = false;
private Stmt getFinalTarget(Stmt stmt) { Stmt finalTarget=null, target; // if not a goto, this is the final target if (!(stmt instanceof GotoStmt)) return stmt; // first map this statement to itself, so we can detect cycles stmtMap.put(stmt, stmt); target = (Stmt)((GotoStmt)stmt).getTarget(); // check if target is in statement map if (stmtMap.containsKey(target)) { // see if it maps to itself finalTarget = stmtMap.get(target); if (finalTarget == target) // this is part of a cycle finalTarget = null; } else finalTarget = getFinalTarget(target); stmtMap.put(stmt, finalTarget); return finalTarget; } // getFinalTarget
private Stmt getFinalTarget(Stmt stmt) { Stmt finalTarget=null, target; // if not a goto, this is the final target if (!(stmt instanceof GotoStmt)) return stmt; // first map this statement to itself, so we can detect cycles stmtMap.put(stmt, stmt); target = (Stmt)((GotoStmt)stmt).getTarget(); // check if target is in statement map if (stmtMap.containsKey(target)) { // see if it maps to itself finalTarget = stmtMap.get(target); if (finalTarget == target) // this is part of a cycle finalTarget = null; } else finalTarget = getFinalTarget(target); stmtMap.put(stmt, finalTarget); return finalTarget; } // getFinalTarget
@Override public void caseGotoStmt(GotoStmt arg0) { precheck(arg0); CfgBlock target = this.methodInfo.lookupCfgBlock(arg0.getTarget()); connectBlocks(currentBlock, target); this.currentBlock = null; }
if (stmt instanceof GotoStmt) { target = (Stmt)((GotoStmt)stmt).getTarget();
if (stmt instanceof GotoStmt) { target = (Stmt)((GotoStmt)stmt).getTarget();