Java 类soot.jimple.CmpExpr 实例源码

项目:JAADAS    文件:DavaBody.java   
private void javafy_binop_expr(ValueBox vb) {
    BinopExpr boe = (BinopExpr) vb.getValue();

    ValueBox leftOpBox = boe.getOp1Box(), rightOpBox = boe.getOp2Box();
    Value leftOp = leftOpBox.getValue(), rightOp = rightOpBox.getValue();

    if (rightOp instanceof IntConstant) {
        if ((leftOp instanceof IntConstant) == false) {
            javafy(leftOpBox);
            leftOp = leftOpBox.getValue();

            if (boe instanceof ConditionExpr)
                rightOpBox.setValue(DIntConstant.v(
                        ((IntConstant) rightOp).value, leftOp.getType()));
            else
                rightOpBox.setValue(DIntConstant.v(
                        ((IntConstant) rightOp).value, null));
        }
    } 
    else if (leftOp instanceof IntConstant) {
        javafy(rightOpBox);
        rightOp = rightOpBox.getValue();

        if (boe instanceof ConditionExpr)
            leftOpBox.setValue(DIntConstant.v(((IntConstant) leftOp).value,
                    rightOp.getType()));
        else
            leftOpBox.setValue(DIntConstant.v(((IntConstant) leftOp).value,
                    null));
    } else {
        javafy(rightOpBox);
        rightOp = rightOpBox.getValue();

        javafy(leftOpBox);
        leftOp = leftOpBox.getValue();
    }

    if (boe instanceof CmpExpr)
        vb.setValue(new DCmpExpr(leftOp, rightOp));

    else if (boe instanceof CmplExpr)
        vb.setValue(new DCmplExpr(leftOp, rightOp));

    else if (boe instanceof CmpgExpr)
        vb.setValue(new DCmpgExpr(leftOp, rightOp));
}
项目:petablox    文件:RelCmpExpr.java   
@Override
public void visit(Value e) {
    if (e instanceof CmpExpr) {
        CmpExpr ce = (CmpExpr) e;
        add(e, ce.getOp1(), ce.getOp2());
    }
}
项目:jgs    文件:AnnotationValueSwitch.java   
@Override
public void caseCmpExpr(CmpExpr v) {
    rightElement = RightElement.NOT;
    if (actualContext == StmtContext.ASSIGNRIGHT) {
        throw new NotSupportedStmtException("CmpExpr");
    }
}
项目:FuzzDroid    文件:JimpleExprVisitorImpl.java   
@Override
public void caseCmpExpr(CmpExpr v) {
    throw new RuntimeException("todo");

}
项目:JAADAS    文件:ValueTemplatePrinter.java   
public void caseCmpExpr(CmpExpr v) {
    printBinaryExpr(v);
}
项目:JAADAS    文件:UseChecker.java   
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));
        }
    }
}
项目:JAADAS    文件:ExprVisitor.java   
@Override
public void caseCmpExpr(CmpExpr v) {
       stmtV.addInsn(buildCmpInsn("CMP_LONG", v.getOp1(), v.getOp2()), origStmt);
}
项目:JAADAS    文件:UnitThrowAnalysis.java   
public void caseCmpExpr(CmpExpr expr) {
    caseBinopExpr(expr);
}
项目:bixie    文件:SootValueSwitch.java   
@Override
public void caseCmpExpr(CmpExpr arg0) {
    translateBinOp(arg0);
}
项目:jar2bpl    文件:SootValueSwitch.java   
@Override
public void caseCmpExpr(CmpExpr arg0) {
    translateBinOp(arg0);
}
项目:jgs    文件:AnnotationValueSwitch.java   
/**
 * DOC
 * 
 * @see soot.jimple.ExprSwitch#caseCmpExpr(soot.jimple.CmpExpr)
 */
@Override
public void caseCmpExpr(CmpExpr v) {
    v.getOp1().apply(this);
    v.getOp2().apply(this);
}
项目:jgs    文件:SecurityConstraintValueWriteSwitch.java   
@Override
public void caseCmpExpr(CmpExpr v) {
    throwInvalidWriteException(v);
}
项目:jgs    文件:SecurityConstraintValueReadSwitch.java   
@Override
public void caseCmpExpr(CmpExpr v) {
    handleBinaryExpr(v.getOp1(), v.getOp2());
}
项目:jgs    文件:SecurityLevelValueWriteSwitch.java   
/**
 * The method should update the <em>security level</em> of a {@link CmpExpr}
 * , 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#caseCmpExpr(soot.jimple.CmpExpr)
 * @throws InvalidSwitchException
 *             Always, because the update is not possible.
 */
@Override
public void caseCmpExpr(CmpExpr v) {
    throw new SwitchException(getMsg("exception.analysis.switch.update_error",
                                     this.getClass().getSimpleName(),
                                     v.getClass().getSimpleName(),
                                     v.toString(),
                                     getSourceLine()));
}
项目:jgs    文件:SecurityLevelValueReadSwitch.java   
/**
 * Looks up the <em>security level</em> for the given binary expression and
 * stores the level in {@link SecurityLevelValueReadSwitch#level}. For a
 * {@link CmpgExpr} 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#caseCmpExpr(soot.jimple.CmpExpr)
 * @see SecurityLevelValueReadSwitch#handleBinaryOperation(BinopExpr)
 */
@Override
public void caseCmpExpr(CmpExpr v) {
    handleBinaryOperation(v);
}