@Override public void caseNegExpr(NegExpr ne) { Value source = ne.getOp(); constantV.setOrigStmt(origStmt); Register sourceReg = regAlloc.asImmediate(source, constantV); Opcode opc; Type type = source.getType(); if (type instanceof IntegerType) { opc = Opcode.NEG_INT; } else if (type instanceof FloatType) { opc = Opcode.NEG_FLOAT; } else if (type instanceof DoubleType) { opc = Opcode.NEG_DOUBLE; } else if (type instanceof LongType) { opc = Opcode.NEG_LONG; } else { throw new RuntimeException("unsupported value type for neg-* opcode: " + type); } stmtV.addInsn(new Insn12x(opc, destinationReg, sourceReg), origStmt); }
public void caseNegExpr(NegExpr v) { String oldName = varName; Value op = v.getOp(); suggestVariableName("op"); String opName = varName; op.apply(this); p.println("Value "+oldName+" = Jimple.v().newNegExpr("+opName+");"); varName = oldName; }
private void javafy_unop_expr(ValueBox vb) { UnopExpr uoe = (UnopExpr) vb.getValue(); javafy(uoe.getOpBox()); if (uoe instanceof LengthExpr) vb.setValue(new DLengthExpr(((LengthExpr) uoe).getOp())); else if (uoe instanceof NegExpr) vb.setValue(new DNegExpr(((NegExpr) uoe).getOp())); }
private Value normalizeNegations(Value v) { if (v instanceof NegExpr) { return ((NegExpr)v).getOp(); } else if (v instanceof BinopExpr) { BinopExpr bo = (BinopExpr)v; if (bo instanceof NeExpr) { return new JEqExpr(bo.getOp1(), bo.getOp2()); } } return v; }
@Override public void caseNegExpr(NegExpr arg0) { // this is arithmetic negative! // logic neg is already translated by soot this.isLeftHandSide = false; arg0.getOp().apply(this); Expression e = this.expressionStack.pop(); this.expressionStack.push(this.pf.mkUnaryExpression(e.getType(), UnaryOperator.ARITHNEGATIVE, e)); }
@Override public void visit(Value e) { if (e instanceof NegExpr) { NegExpr ne = (NegExpr) e; add(e, ne.getOp()); } }
@Override public void caseNegExpr(NegExpr v) { rightElement = RightElement.NOT; if (actualContext == StmtContext.ASSIGNRIGHT) { throw new NotSupportedStmtException("NegExpr"); } }
@Override public void caseNegExpr(NegExpr v) { throw new RuntimeException("todo"); }
public void caseNegExpr(NegExpr expr) { result = result.add(mightThrow(expr.getOp())); }
@Override public void caseNegExpr(NegExpr v) { throwInvalidWriteException(v); }
@Override public void caseNegExpr(NegExpr v) { handleUnaryExpr(v.getOp()); }
/** * The method should update the <em>security level</em> of an expression * with type {@link NegExpr}, but it is not possible to update the level of * such an expression. * * @param v * The expression for which the <em>security level</em> should be * updated. * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr) * @throws InvalidSwitchException * Always, because the update is not possible. */ @Override public void caseNegExpr(NegExpr v) { throw new SwitchException(getMsg("exception.analysis.switch.update_error", this.getClass().getSimpleName(), v.getClass().getSimpleName(), v.toString(), getSourceLine())); }
/** * DOC * * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr) */ @Override public void caseNegExpr(NegExpr v) { v.getOp().apply(this); }
/** * Looks up the <em>security level</em> for the given negation expression * and stores the level in {@link SecurityLevelValueReadSwitch#level}. * * @param v * The length negation for which the <em>security level</em> * should be looked up. * @see soot.jimple.ExprSwitch#caseNegExpr(soot.jimple.NegExpr) * @see SecurityLevelValueReadSwitch#handleUnaryOperation(UnopExpr) */ @Override public void caseNegExpr(NegExpr v) { handleUnaryOperation(v); }