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

Java EqExpr类代码示例

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

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



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

示例1: getNullIfCandidates

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * Collect all the if statements comparing two locals with an Eq or Ne
 * expression
 *
 * @param body
 *            the body to analyze
 */
private Set<IfStmt> getNullIfCandidates(Body body) {
	Set<IfStmt> candidates = new HashSet<IfStmt>();
	Iterator<Unit> i = body.getUnits().iterator();
	while (i.hasNext()) {
		Unit u = i.next();
		if (u instanceof IfStmt) {
			ConditionExpr expr = (ConditionExpr) ((IfStmt) u).getCondition();
			boolean isTargetIf = false;
			if (((expr instanceof EqExpr) || (expr instanceof NeExpr))) {
				if (expr.getOp1() instanceof Local && expr.getOp2() instanceof Local) {
					isTargetIf = true;
				}
			}
			if (isTargetIf) {
				candidates.add((IfStmt) u);
				Debug.printDbg("[add if candidate: ", u);
			}

		}
	}

	return candidates;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:31,代码来源:DexIfTransformer.java


示例2: internalTransform

import soot.jimple.EqExpr; //导入依赖的package包/类
public void internalTransform(Body body, String phaseName, Map<String,String> options) {

	// really, the analysis should be able to use its own results to determine
	// that some branches are dead, but since it doesn't we just iterate.
	boolean changed;
	do {
	    changed=false;

	    NullnessAnalysis analysis=analysisFactory.newAnalysis(new ExceptionalUnitGraph(body));
	    
	    Chain<Unit> units=body.getUnits();
	    Stmt s;
	    for(s=(Stmt) units.getFirst();s!=null;s=(Stmt) units.getSuccOf(s)) {
		if(!(s instanceof IfStmt)) continue;
		IfStmt is=(IfStmt) s;
		Value c=is.getCondition();
		if(!(c instanceof EqExpr || c instanceof NeExpr)) continue;
		BinopExpr e=(BinopExpr) c;
		Immediate i=null;
		if(e.getOp1() instanceof NullConstant) i=(Immediate) e.getOp2();
		if(e.getOp2() instanceof NullConstant) i=(Immediate) e.getOp1();
		if(i==null) continue;
		boolean alwaysNull = analysis.isAlwaysNullBefore(s, i);
		boolean alwaysNonNull = analysis.isAlwaysNonNullBefore(s, i);
		int elim=0; // -1 => condition is false, 1 => condition is true
		if(alwaysNonNull) elim=c instanceof EqExpr ? -1 : 1;
		if(alwaysNull) elim=c instanceof EqExpr ? 1 : -1;
		Stmt newstmt=null;
		if(elim==-1) newstmt=Jimple.v().newNopStmt();
		if(elim==1) newstmt=Jimple.v().newGotoStmt(is.getTarget());
		if(newstmt!=null) {
		    units.swapWith(s,newstmt);
		    s=newstmt;
		    changed=true;
		}
	    }
	} while(changed);
    }
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:39,代码来源:NullCheckEliminator.java


示例3: isZeroComparison

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * Examine expr if it is a comparison with 0.
 *
 * @param expr
 *            the ConditionExpr to examine
 */
protected boolean isZeroComparison(ConditionExpr expr) {
	if (expr instanceof EqExpr || expr instanceof NeExpr) {
		if (expr.getOp2() instanceof IntConstant
				&& ((IntConstant) expr.getOp2()).value == 0)
			return true;
		if (expr.getOp2() instanceof LongConstant
				&& ((LongConstant) expr.getOp2()).value == 0)
			return true;
	}
	return false;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:18,代码来源:AbstractNullTransformer.java


示例4: visit

import soot.jimple.EqExpr; //导入依赖的package包/类
@Override
public void visit(Value e) {
	if (e instanceof EqExpr) {
		EqExpr ee = (EqExpr) e;
		add(e, ee.getOp1(), ee.getOp2());
	}
}
 
开发者ID:petablox-project,项目名称:petablox,代码行数:8,代码来源:RelEqExpr.java


示例5: caseEqExpr

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


示例6: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
public void caseEqExpr(EqExpr v) {
	printBinaryExpr(v);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:4,代码来源:ValueTemplatePrinter.java


示例7: handleBinopExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
private void handleBinopExpr(BinopExpr be, Stmt stmt, Type tlhs)
{
	Value opl = be.getOp1(), opr = be.getOp2();
	Type tl = AugEvalFunction.eval_(this.tg, opl, stmt, this.jb),
		tr = AugEvalFunction.eval_(this.tg, opr, stmt, this.jb);

	if ( be instanceof AddExpr
		|| be instanceof SubExpr
		|| be instanceof MulExpr
		|| be instanceof DivExpr
		|| be instanceof RemExpr
		|| be instanceof GeExpr
		|| be instanceof GtExpr
		|| be instanceof LeExpr
		|| be instanceof LtExpr
		|| be instanceof ShlExpr
		|| be instanceof ShrExpr
		|| be instanceof UshrExpr )
	{
		if ( tlhs instanceof IntegerType )
		{
			be.setOp1(this.uv.visit(opl, IntType.v(), stmt));
			be.setOp2(this.uv.visit(opr, IntType.v(), stmt));
		}
	}
	else if ( be instanceof CmpExpr
		|| be instanceof CmpgExpr
		|| be instanceof CmplExpr )
	{
		// No checks in the original assigner
	}
	else if ( be instanceof AndExpr
		|| be instanceof OrExpr
		|| be instanceof XorExpr )
	{
		be.setOp1(this.uv.visit(opl, tlhs, stmt));
		be.setOp2(this.uv.visit(opr, tlhs, stmt));
	}
	else if ( be instanceof EqExpr
		|| be instanceof NeExpr )
	{
		if ( tl instanceof BooleanType && tr instanceof BooleanType )
		{ }
		else if ( tl instanceof Integer1Type || tr instanceof Integer1Type )
		{ }
		else if ( tl instanceof IntegerType )
		{
			be.setOp1(this.uv.visit(opl, IntType.v(), stmt));
			be.setOp2(this.uv.visit(opr, IntType.v(), stmt));
		}
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:53,代码来源:UseChecker.java


示例8: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
@Override
public void caseEqExpr(EqExpr ee) {
       stmtV.addInsn(buildComparingBinaryInsn("EQ", ee.getOp1(), ee.getOp2()), origStmt);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:5,代码来源:ExprVisitor.java


示例9: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
public void caseEqExpr(EqExpr expr) {
    caseBinopExpr(expr);
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:4,代码来源:UnitThrowAnalysis.java


示例10: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
@Override
public void caseEqExpr(EqExpr arg0) {
	translateBinOp(arg0);
}
 
开发者ID:SRI-CSL,项目名称:bixie,代码行数:5,代码来源:SootValueSwitch.java


示例11: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * DOC
 * 
 * @see soot.jimple.ExprSwitch#caseEqExpr(soot.jimple.EqExpr)
 */
@Override
public void caseEqExpr(EqExpr v) {
    v.getOp1().apply(this);
    v.getOp2().apply(this);
}
 
开发者ID:proglang,项目名称:jgs,代码行数:11,代码来源:AnnotationValueSwitch.java


示例12: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
@Override
public void caseEqExpr(EqExpr v) {
    throwInvalidWriteException(v);
}
 
开发者ID:proglang,项目名称:jgs,代码行数:5,代码来源:SecurityConstraintValueWriteSwitch.java


示例13: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
@Override
public void caseEqExpr(EqExpr v) {
    handleBinaryExpr(v.getOp1(), v.getOp2());
}
 
开发者ID:proglang,项目名称:jgs,代码行数:5,代码来源:SecurityConstraintValueReadSwitch.java


示例14: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * It is not neccessary to treat arithmetic expressions. The SecurityLevels
 * of this expressions are treated at an other place.
 * @param v an arithmetic expression
 */
@Override
public void caseEqExpr(EqExpr v) {
	logger.finest("Eq Expr identified " + callingStmt.toString());
	rightElement = RightElement.NOT;
}
 
开发者ID:proglang,项目名称:jgs,代码行数:11,代码来源:AnnotationValueSwitch.java


示例15: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * The method should update the <em>security level</em> of a {@link EqExpr},
 * but it is not possible to update the level of an expression.
 * 
 * @param v
 *            The expression for which the <em>security level</em> should be
 *            updated.
 * @see soot.jimple.ExprSwitch#caseEqExpr(soot.jimple.EqExpr)
 * @throws InvalidSwitchException
 *             Always, because the update is not possible.
 */
@Override
public void caseEqExpr(EqExpr v) {
    throw new SwitchException(getMsg("exception.analysis.switch.update_error",
                                     this.getClass().getSimpleName(),
                                     v.getClass().getSimpleName(),
                                     v.toString(),
                                     getSourceLine()));
}
 
开发者ID:proglang,项目名称:jgs,代码行数:20,代码来源:SecurityLevelValueWriteSwitch.java


示例16: caseEqExpr

import soot.jimple.EqExpr; //导入依赖的package包/类
/**
 * Looks up the <em>security level</em> for the given binary expression and
 * stores the level in {@link SecurityLevelValueReadSwitch#level}. For a
 * {@link EqExpr} this is the strongest operand <em>security level</em> of
 * the given binary expression.
 * 
 * @param v
 *            The expression for which the <em>security level</em> should be
 *            looked up.
 * @see soot.jimple.ExprSwitch#caseEqExpr(soot.jimple.EqExpr)
 * @see SecurityLevelValueReadSwitch#handleBinaryOperation(BinopExpr)
 */
@Override
public void caseEqExpr(EqExpr v) {
    handleBinaryOperation(v);
}
 
开发者ID:proglang,项目名称:jgs,代码行数:17,代码来源:SecurityLevelValueReadSwitch.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java EntityHusk类代码示例发布时间:2022-05-23
下一篇:
Java Element类代码示例发布时间: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