• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TableSwitchStmt类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中soot.jimple.TableSwitchStmt的典型用法代码示例。如果您正苦于以下问题:Java TableSwitchStmt类的具体用法?Java TableSwitchStmt怎么用?Java TableSwitchStmt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TableSwitchStmt类属于soot.jimple包,在下文中一共展示了TableSwitchStmt类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
	p.openBlock();
	String varName = printValueAssignment(stmt.getKey(),"key");
	
	int lowIndex= stmt.getLowIndex();
	p.println("int lowIndex=" + lowIndex + ";");
	

	int highIndex= stmt.getHighIndex();
	p.println("int highIndex=" + highIndex + ";");
	
	p.println("List<Unit> targets = new LinkedList<Unit>();");
	for(Unit s: stmt.getTargets()) {
		String nameOfJumpTarget = nameOfJumpTarget(s);
		p.println("targets.add("+nameOfJumpTarget+")");
	}
	
	Unit defaultTarget = stmt.getDefaultTarget();
	p.println("Unit defaultTarget = " + nameOfJumpTarget(defaultTarget) + ";");

	printStmt(stmt, varName, "lowIndex", "highIndex", "targets", "defaultTarget");
	
	p.closeBlock();
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:25,代码来源:StmtTemplatePrinter.java


示例2: convertTableSwitchInsn

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
private void convertTableSwitchInsn(TableSwitchInsnNode 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);
	}
	TableSwitchStmt tss = Jimple.v().newTableSwitchStmt(key.stackOrValue(),
			insn.min, insn.max, targets, dflt);
	key.addBox(tss.getKeyBox());
	frame.in(key);
	frame.boxes(tss.getKeyBox());
	setUnit(insn, tss);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:23,代码来源:AsmMethodSource.java


示例3: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public void caseTableSwitchStmt(TableSwitchStmt 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(20)");
			}
		}
		resolver.typeVariable((Local) key).addParent(resolver.INT);
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:16,代码来源:ConstraintChecker.java


示例4: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public void caseTableSwitchStmt(TableSwitchStmt 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: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public void caseTableSwitchStmt(TableSwitchStmt 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: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
       exprV.setOrigStmt(stmt);
       constantV.setOrigStmt(stmt);
	// create payload that references the switch's targets
	int firstKey = stmt.getLowIndex();		
	List<Unit> targets = stmt.getTargets();
	PackedSwitchPayload payload = new PackedSwitchPayload(firstKey, targets);
	switchPayloads.add(payload);
	// create packed-switch instruction that references the payload
	Value key = stmt.getKey();
	Stmt defaultTarget = (Stmt) stmt.getDefaultTarget();
       addInsn(buildSwitchInsn(Opcode.PACKED_SWITCH, key, defaultTarget,
       		payload, stmt), stmt);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:16,代码来源:StmtVisitor.java


示例7: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
	logger.fine("\n > > > Table 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,代码行数:34,代码来源:AnnotationStmtSwitch.java


示例8: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
	logger.fine("\n > > > Table 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,代码行数:33,代码来源:AnnotationStmtSwitch.java


示例9: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
	throw new RuntimeException("todo");
	
}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:6,代码来源:JimpleStmtVisitorImpl.java


示例10: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public void caseTableSwitchStmt(TableSwitchStmt stmt)
{
	stmt.setKey(this.uv.visit(stmt.getKey(), IntType.v(), stmt));
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:5,代码来源:UseChecker.java


示例11: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt s) {
    result = result.add(mightThrow(s.getKey()));
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:5,代码来源:UnitThrowAnalysis.java


示例12: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
    handleBranch(stmt.getKey(), new TableSwitchProgramCounterTrigger(stmt));
}
 
开发者ID:proglang,项目名称:jgs,代码行数:5,代码来源:SecurityConstraintStmtSwitch.java


示例13: TableSwitchProgramCounterTrigger

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public TableSwitchProgramCounterTrigger(TableSwitchStmt stmt) {
    this.stmt = stmt;
}
 
开发者ID:proglang,项目名称:jgs,代码行数:4,代码来源:TableSwitchProgramCounterTrigger.java


示例14: getTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
public final TableSwitchStmt getTableSwitchStmt() {
    return stmt;
}
 
开发者ID:proglang,项目名称:jgs,代码行数:4,代码来源:TableSwitchProgramCounterTrigger.java


示例15: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
/**
 * Method, which should process the given statement of type
 * {@link TableSwitchStmt}, 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#caseTableSwitchStmt(soot.jimple.TableSwitchStmt)
 * @throws UnimplementedSwitchException
 *             Method throws always this exception, because the method is
 *             not implemented.
 */
@Override
public void caseTableSwitchStmt(TableSwitchStmt 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


示例16: caseTableSwitchStmt

import soot.jimple.TableSwitchStmt; //导入依赖的package包/类
/**
 * DOC
 * 
 * @see soot.jimple.StmtSwitch#caseTableSwitchStmt(soot.jimple.TableSwitchStmt)
 */
@Override
public void caseTableSwitchStmt(TableSwitchStmt stmt) {
    // TODO: Consider reaction
}
 
开发者ID:proglang,项目名称:jgs,代码行数:10,代码来源:AnnotationStmtSwitch.java



注:本文中的soot.jimple.TableSwitchStmt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MutableModuleExtension类代码示例发布时间:2022-05-23
下一篇:
Java SwiftNativeFileSystemStore类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap