本文整理汇总了Java中soot.jimple.GotoStmt类的典型用法代码示例。如果您正苦于以下问题:Java GotoStmt类的具体用法?Java GotoStmt怎么用?Java GotoStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GotoStmt类属于soot.jimple包,在下文中一共展示了GotoStmt类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: instrumentEachBranchAccess
import soot.jimple.GotoStmt; //导入依赖的package包/类
private void instrumentEachBranchAccess(Body body, Unit unit){
SootClass sootClass = Scene.v().getSootClass(
UtilInstrumenter.JAVA_CLASS_FOR_PATH_INSTRUMENTATION);
// Create the method invocation
SootMethod createAndAdd = sootClass.getMethod("reportConditionOutcomeSynchronous",
Collections.<Type>singletonList(BooleanType.v()));
StaticInvokeExpr sieThen = Jimple.v().newStaticInvokeExpr(
createAndAdd.makeRef(), IntConstant.v(1));
StaticInvokeExpr sieElse = Jimple.v().newStaticInvokeExpr(
createAndAdd.makeRef(), IntConstant.v(0));
Unit sieThenUnit = Jimple.v().newInvokeStmt(sieThen);
sieThenUnit.addTag(new InstrumentedCodeTag());
Unit sieElseUnit = Jimple.v().newInvokeStmt(sieElse);
sieElseUnit.addTag(new InstrumentedCodeTag());
//treatment of target statement ("true"-branch)
IfStmt ifStmt = (IfStmt)unit;
Stmt targetStmt = ifStmt.getTarget();
if(!branchTargetStmt.contains(targetStmt.toString())) {
branchTargetStmt.add(sieThenUnit.toString());
body.getUnits().insertBefore(sieThenUnit, targetStmt);
NopStmt nop = Jimple.v().newNopStmt();
GotoStmt gotoNop = Jimple.v().newGotoStmt(nop);
body.getUnits().insertBeforeNoRedirect(nop, targetStmt);
body.getUnits().insertBeforeNoRedirect(gotoNop, sieThenUnit);
}
//treatment of "else"-branch
body.getUnits().insertAfter(sieElseUnit, unit);
}
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:34,代码来源:ConditionTracking.java
示例2: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
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);
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:10,代码来源:StmtTemplatePrinter.java
示例3: internalTransform
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
protected void internalTransform(Body body, String phaseName,
Map<String, String> options) {
Iterator<Unit> it = body.getUnits().snapshotIterator();
while (it.hasNext()) {
Unit u = it.next();
if (u instanceof GotoStmt) {
GotoStmt gtStmt = (GotoStmt) u;
if (gtStmt.getTarget() instanceof AssignStmt) {
AssignStmt assign = (AssignStmt) gtStmt.getTarget();
if (assign.getRightOp() instanceof CastExpr) {
CastExpr ce = (CastExpr) assign.getRightOp();
// We have goto that ends up at a cast statement
Unit nextStmt = body.getUnits().getSuccOf(assign);
if (nextStmt instanceof ReturnStmt) {
ReturnStmt retStmt = (ReturnStmt) nextStmt;
if (retStmt.getOp() == assign.getLeftOp()) {
// We need to replace the GOTO with the return
ReturnStmt newStmt = (ReturnStmt) retStmt.clone();
newStmt.setOp(ce.getOp());
for (Trap t : body.getTraps())
for (UnitBox ubox : t.getUnitBoxes())
if (ubox.getUnit() == gtStmt)
ubox.setUnit(newStmt);
while (!gtStmt.getBoxesPointingToThis().isEmpty())
gtStmt.getBoxesPointingToThis().get(0).setUnit(newStmt);
body.getUnits().swapWith(gtStmt, newStmt);
}
}
}
}
}
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:37,代码来源:CastAndReturnInliner.java
示例4: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt arg0) {
injectLabelStatements(arg0);
String labelName = GlobalsCache.v().getUnitLabel(
(Stmt) arg0.getTarget());
this.boogieStatements.add(this.pf.mkGotoStatement(labelName));
// if (labelName.contains("block324")) throw new
// RuntimeException("there it is!");
}
开发者ID:SRI-CSL,项目名称:bixie,代码行数:10,代码来源:SootStmtSwitch.java
示例5: isBranch
import soot.jimple.GotoStmt; //导入依赖的package包/类
public static boolean isBranch(Unit u){
if(u instanceof IfStmt ||
u instanceof GotoStmt ||
u instanceof SwitchStmt ||
u instanceof ThrowStmt ||
u instanceof ReturnStmt ||
u instanceof ReturnVoidStmt)
return true;
return false;
}
开发者ID:petablox-project,项目名称:petablox,代码行数:11,代码来源:SootUtilities.java
示例6: seekTarget
import soot.jimple.GotoStmt; //导入依赖的package包/类
private Unit seekTarget(Unit u) {
int count = 10;
Unit target = u;
while(count-- > 0 && target != null && target instanceof GotoStmt) {
target = ((GotoStmt) target).getTarget();
}
return target;
}
开发者ID:Orange-OpenSource,项目名称:matos-tool,代码行数:9,代码来源:ExceptionAnalysis.java
示例7: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt stmt) {
throw new RuntimeException("todo");
}
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:6,代码来源:JimpleStmtVisitorImpl.java
示例8: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
public void caseGotoStmt(GotoStmt stmt) {
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:3,代码来源:ConstraintChecker.java
示例9: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt stmt) {
Stmt target = (Stmt) stmt.getTarget();
addInsn(buildGotoInsn(target), stmt);
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:6,代码来源:StmtVisitor.java
示例10: isInstanceofFlowChange
import soot.jimple.GotoStmt; //导入依赖的package包/类
private boolean isInstanceofFlowChange(Unit u) {
if (u instanceof GotoStmt || isInstanceofReturn(u))
return true;
return false;
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:6,代码来源:DexReturnInliner.java
示例11: gotoStatement
import soot.jimple.GotoStmt; //导入依赖的package包/类
private GotoStmt gotoStatement() {
GotoStmt go = Jimple.v().newGotoStmt(targetInstruction.getUnit());
setUnit(go);
addTags(go);
return go;
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:7,代码来源:GotoInstruction.java
示例12: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt s) {
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:4,代码来源:UnitThrowAnalysis.java
示例13: isJumpStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
private boolean isJumpStmt(Stmt st) {
return ( st instanceof ThrowStmt || st instanceof GotoStmt || st instanceof ReturnStmt);
}
开发者ID:SRI-CSL,项目名称:bixie,代码行数:4,代码来源:SootBodyTransformer.java
示例14: run
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void run(SpyResult result, AppDescription app) {
Scene scene = Scene.v();
int count = 0;
Iterator<SootClass> classes = scene.getApplicationClasses().iterator();
while(classes.hasNext()) {
SootClass clazz = classes.next();
for (SootMethod method : clazz.getMethods()) {
if(!method.hasActiveBody()) continue;
Body body = method.getActiveBody();
Chain<Unit> code = body.getUnits();
Iterator<Trap> traps = body.getTraps().iterator();
while(traps.hasNext()) {
boolean bogus = false;
Trap trap = traps.next();
Unit lastOfCatch = trap.getEndUnit();
// System.err.println("Last of catch " + lastOfCatch);
Unit firstHandler = trap.getHandlerUnit();
// System.err.println("First of handler " + firstHandler);
Unit nextHandler = code.getSuccOf(firstHandler);
// System.err.println("Next handler " + nextHandler);
if (nextHandler == null) continue;
Unit handlerTarget = seekTarget(nextHandler);
if (handlerTarget == null) continue;
// System.err.println("handler goto " + handlerTarget + handlerTarget.getClass());
if (handlerTarget instanceof ReturnVoidStmt) {
bogus = true;
} else if (lastOfCatch instanceof GotoStmt) {
bogus = handlerTarget.equals(seekTarget(lastOfCatch));
} else {
if (!lastOfCatch.fallsThrough()) continue;
Unit targetCatch = code.getSuccOf(lastOfCatch);
if (targetCatch == null) continue; // This had to be a return.
// System.err.println("Target 1" + targetCatch);
if (handlerTarget.equals(targetCatch)) bogus = true;
if (targetCatch.fallsThrough() && !targetCatch.branches()) {
targetCatch = code.getSuccOf(targetCatch);
// System.err.println("Target 2" + targetCatch);
if (handlerTarget.equals(targetCatch)) bogus = true;
}
}
// System.err.println(bogus);
if (bogus) {
BytecodeOffsetTag tag = (BytecodeOffsetTag) firstHandler.getTag("BytecodeOffsetTag");
int offset = (tag == null) ? -1 : tag.getBytecodeOffset();
result.setCustomResult(listItem("android.empty.exception.class",count),clazz.getName());
result.setCustomResult(listItem("android.empty.exception.method",count),method.getSubSignature());
result.setCustomResult(listItem("android.empty.exception.pos",count),offset);
count++;
}
}
result.setCustomResult("android.empty.exception.error", count > 0);
result.setCustomResult("android.empty.exception.count", count);
}
}
}
开发者ID:Orange-OpenSource,项目名称:matos-tool,代码行数:59,代码来源:ExceptionAnalysis.java
示例15: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt stmt) {
}
开发者ID:proglang,项目名称:jgs,代码行数:4,代码来源:SecurityConstraintStmtSwitch.java
示例16: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt stmt) {
logger.fine("\n > > > Goto statement identified < < <");
valueSwitch.callingStmt = stmt;
logger.fine("GOTO: " + stmt.toString());
}
开发者ID:proglang,项目名称:jgs,代码行数:7,代码来源:AnnotationStmtSwitch.java
示例17: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
@Override
public void caseGotoStmt(GotoStmt stmt) {
logger.fine("\n > > > Goto statement identified < < <");
logger.fine("GOTO: " + stmt.toString());
}
开发者ID:proglang,项目名称:jgs,代码行数:6,代码来源:AnnotationStmtSwitch.java
示例18: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
/**
* DOC
*
* @see soot.jimple.StmtSwitch#caseGotoStmt(soot.jimple.GotoStmt)
*/
@Override
public void caseGotoStmt(GotoStmt stmt) {
}
开发者ID:proglang,项目名称:jgs,代码行数:9,代码来源:AnnotationStmtSwitch.java
示例19: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
/**
* Method, which should process the given statement of type {@link GotoStmt}
* . In this case, there is no reason to check the statement in more detail.
* Because of that nothing will be done for a goto statement.
*
* @param stmt
* Statement that should be processed to check for security
* violations.
* @see soot.jimple.StmtSwitch#caseGotoStmt(soot.jimple.GotoStmt)
*/
@Override
public void caseGotoStmt(GotoStmt stmt) {
// Nothing to do in case of a goto stmt
}
开发者ID:proglang,项目名称:jgs,代码行数:15,代码来源:SecurityLevelStmtSwitch.java
示例20: caseGotoStmt
import soot.jimple.GotoStmt; //导入依赖的package包/类
public void caseGotoStmt(GotoStmt stmt) { }
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:2,代码来源:UseChecker.java
注:本文中的soot.jimple.GotoStmt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论