本文整理汇总了Java中soot.jimple.LookupSwitchStmt类的典型用法代码示例。如果您正苦于以下问题:Java LookupSwitchStmt类的具体用法?Java LookupSwitchStmt怎么用?Java LookupSwitchStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LookupSwitchStmt类属于soot.jimple包,在下文中一共展示了LookupSwitchStmt类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
exprV.setOrigStmt(stmt);
constantV.setOrigStmt(stmt);
// create payload that references the switch's targets
List<IntConstant> keyValues = stmt.getLookupValues();
int[] keys = new int[keyValues.size()];
for (int i = 0; i < keys.length; i++) {
keys[i] = keyValues.get(i).value;
}
List<Unit> targets = stmt.getTargets();
SparseSwitchPayload payload = new SparseSwitchPayload(keys, targets);
switchPayloads.add(payload);
// create sparse-switch instruction that references the payload
Value key = stmt.getKey();
Stmt defaultTarget = (Stmt) stmt.getDefaultTarget();
if (defaultTarget == stmt)
throw new RuntimeException("Looping switch block detected");
addInsn(buildSwitchInsn(Opcode.SPARSE_SWITCH, key, defaultTarget,
payload, stmt), stmt);
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:22,代码来源:StmtVisitor.java
示例2: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
p.openBlock();
String keyVarName = printValueAssignment(stmt.getKey(), "key");
p.println("List<IntConstant> lookupValues = new LinkedList<IntConstant>();");
int i=0;
for(IntConstant c: (List<IntConstant>)stmt.getLookupValues()) {
vtp.suggestVariableName("lookupValue"+i);
c.apply(vtp);
i++;
p.println("lookupValues.add(lookupValue"+i+");");
}
p.println("List<Unit> targets = new LinkedList<Unit>();");
for(Unit u : stmt.getTargets()) {
String nameOfJumpTarget = nameOfJumpTarget(u);
p.println("targets.add("+nameOfJumpTarget+")");
}
Unit defaultTarget = stmt.getDefaultTarget();
p.println("Unit defaultTarget=" + defaultTarget.toString() + ";");
printStmt(stmt, keyVarName, "lookupValues", "targets", "defaultTarget");
p.closeBlock();
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:29,代码来源:StmtTemplatePrinter.java
示例3: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
Value key = stmt.getKey();
if (key instanceof Local) {
if (!ClassHierarchy.v().typeNode(((Local) key).getType())
.hasAncestor_1(ClassHierarchy.v().INT)) {
if (fix) {
stmt.setKey(insertCast((Local) key, IntType.v(), stmt));
} else {
error("Type Error(18)");
}
}
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:15,代码来源:ConstraintChecker.java
示例4: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
if (uses) {
Value key = stmt.getKey();
if (key instanceof Local) {
resolver.typeVariable((Local) key).addParent(resolver.INT);
}
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:10,代码来源:ConstraintCollector.java
示例5: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
if (uses) {
Value key = stmt.getKey();
if (key instanceof Local) {
resolver.typeVariable((Local) key).addParent(resolver.typeVariable(IntType.v()));
}
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:10,代码来源:ConstraintCollector.java
示例6: internalTransform
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
protected void internalTransform(Body b, String phaseName, Map<String,String> options)
{
Iterator<Unit> it = b.getUnits().snapshotIterator();
while (it.hasNext()) {
Unit u = it.next();
if (u instanceof LookupSwitchStmt) {
LookupSwitchStmt sw = (LookupSwitchStmt) u;
if (sw.getTargetCount() == 0 && sw.getDefaultTarget() != null)
b.getUnits().swapWith(sw, Jimple.v().newGotoStmt(sw.getDefaultTarget()));
}
}
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:14,代码来源:EmptySwitchEliminator.java
示例7: convertLookupSwitchInsn
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
private void convertLookupSwitchInsn(LookupSwitchInsnNode insn) {
StackFrame frame = getFrame(insn);
if (units.containsKey(insn)) {
frame.mergeIn(pop());
return;
}
Operand key = popImmediate();
UnitBox dflt = Jimple.v().newStmtBox(null);
List<UnitBox> targets = new ArrayList<UnitBox>(insn.labels.size());
labels.put(insn.dflt, dflt);
for (LabelNode ln : insn.labels) {
UnitBox box = Jimple.v().newStmtBox(null);
targets.add(box);
labels.put(ln, box);
}
List<IntConstant> keys = new ArrayList<IntConstant>(insn.keys.size());
for (Integer i : insn.keys)
keys.add(IntConstant.v(i));
LookupSwitchStmt lss = Jimple.v().newLookupSwitchStmt(key.stackOrValue(),
keys, targets, dflt);
key.addBox(lss.getKeyBox());
frame.in(key);
frame.boxes(lss.getKeyBox());
setUnit(insn, lss);
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:29,代码来源:AsmMethodSource.java
示例8: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
/**
* DOC
*
* @see soot.jimple.StmtSwitch#caseLookupSwitchStmt(soot.jimple.LookupSwitchStmt)
*/
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
// TODO: Consider reaction
// stmt.getKey().apply(valueSwitch);
// for (int i = 0; i < stmt.getTargetCount(); i++) {
// stmt.getTarget(i).apply(valueSwitch);
// }
}
开发者ID:proglang,项目名称:jgs,代码行数:14,代码来源:AnnotationStmtSwitch.java
示例9: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
logger.fine("\n > > > Lookup switch statement identified < < <");
valueSwitch.callingStmt = stmt;
logger.finest("Use and def boxes of SwitchStmt: "
+ stmt.getUseAndDefBoxes().toString());
// Check for all values in the condition if they are a constant value
// or if they are stored in a local. In the second case the local is
// added
// to a list for the locals.
List<ValueBox> valueList = stmt.getUseBoxes();
ArrayList<Local> localList = new ArrayList<Local>();
for (ValueBox v : valueList) {
Value val = v.getValue();
if (val instanceof Local) {
localList.add((Local) val);
logger.fine("New local added to local-list of SwitchStmt: "
+ val);
}
}
int localListLength = localList.size();
Local[] arguments = new Local[localListLength];
for (int i = 0; i < localListLength; i++) {
arguments[i] = localList.get(i);
}
JimpleInjector.checkCondition(stmt, arguments);
}
开发者ID:proglang,项目名称:jgs,代码行数:33,代码来源:AnnotationStmtSwitch.java
示例10: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
logger.fine("\n > > > Lookup switch statement identified < < <");
logger.finest("Use and def boxes of SwitchStmt: "
+ stmt.getUseAndDefBoxes().toString());
// Check for all values in the condition if they are a constant value
// or if they are stored in a local. In the second case the local is
// added
// to a list for the locals.
List<ValueBox> valueList = stmt.getUseBoxes();
ArrayList<Local> localList = new ArrayList<Local>();
for (ValueBox v : valueList) {
Value val = v.getValue();
if (val instanceof Local) {
localList.add((Local) val);
logger.fine("New local added to local-list of SwitchStmt: "
+ val);
}
}
int localListLength = localList.size();
Local[] arguments = new Local[localListLength];
for (int i = 0; i < localListLength; i++) {
arguments[i] = localList.get(i);
}
JimpleInjector.checkCondition(stmt, arguments);
}
开发者ID:proglang,项目名称:jgs,代码行数:32,代码来源:AnnotationStmtSwitch.java
示例11: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
throw new RuntimeException("todo");
}
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:6,代码来源:JimpleStmtVisitorImpl.java
示例12: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public void caseLookupSwitchStmt(LookupSwitchStmt stmt)
{
stmt.setKey(this.uv.visit(stmt.getKey(), IntType.v(), stmt));
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:5,代码来源:UseChecker.java
示例13: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt s) {
result = result.add(mightThrow(s.getKey()));
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:5,代码来源:UnitThrowAnalysis.java
示例14: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
handleBranch(stmt.getKey(), new LookupSwitchProgramCounterTrigger(stmt));
}
开发者ID:proglang,项目名称:jgs,代码行数:5,代码来源:SecurityConstraintStmtSwitch.java
示例15: LookupSwitchProgramCounterTrigger
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public LookupSwitchProgramCounterTrigger(LookupSwitchStmt stmt) {
this.stmt = stmt;
}
开发者ID:proglang,项目名称:jgs,代码行数:4,代码来源:LookupSwitchProgramCounterTrigger.java
示例16: getLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
public final LookupSwitchStmt getLookupSwitchStmt() {
return stmt;
}
开发者ID:proglang,项目名称:jgs,代码行数:4,代码来源:LookupSwitchProgramCounterTrigger.java
示例17: caseLookupSwitchStmt
import soot.jimple.LookupSwitchStmt; //导入依赖的package包/类
/**
* Method, which should process the given statement of type
* {@link LookupSwitchStmt}, but is not implemented in the current version
* of this method. If method will be called an exception is thrown.
*
* @param stmt
* Statement that should be processed to check for security
* violations.
* @see soot.jimple.StmtSwitch#caseLookupSwitchStmt(soot.jimple.LookupSwitchStmt)
* @throws UnimplementedSwitchException
* Method throws always this exception, because the method is
* not implemented.
*/
@Override
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) {
throw new SwitchException(getMsg("exception.analysis.switch.not_implemented",
stmt.toString(),
getSourceLine(),
stmt.getClass().getSimpleName(),
this.getClass().getSimpleName()));
}
开发者ID:proglang,项目名称:jgs,代码行数:22,代码来源:SecurityLevelStmtSwitch.java
注:本文中的soot.jimple.LookupSwitchStmt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论