public static IntConstant v(int value) { return new IntConstant(value); }
public void caseNewMultiArrayExpr(NewMultiArrayExpr expr) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); for (int i = 0; i < expr.getSizeCount(); i++) { Value count = expr.getSize(i); if ((!(count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO).equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); } }
private void caseBinopDivExpr(BinopExpr expr) { // Factors out code common to caseDivExpr and caseRemExpr. // The checks against constant divisors would perhaps be // better performed in a later pass, post-constant-propagation. Value divisor = expr.getOp2(); Type divisorType = divisor.getType(); if (divisorType instanceof UnknownType) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType instanceof IntegerType) && ((!(divisor instanceof IntConstant)) || (((IntConstant) divisor).equals(INT_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType == LongType.v()) && ((!(divisor instanceof LongConstant)) || (((LongConstant) divisor).equals(LONG_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } caseBinopExpr(expr); }
public void caseNewArrayExpr(NewArrayExpr expr) { if (expr.getBaseType() instanceof RefLikeType) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); } Value count = expr.getSize(); if ((!(count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO).equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); }
private void caseBinopDivExpr(BinopExpr expr) { // Factors out code common to caseDivExpr and caseRemExpr. // The checks against constant divisors would perhaps be // better performed in a later pass, post-constant-propagation. Value divisor = expr.getOp2(); Type divisorType = divisor.getType(); if (divisorType instanceof UnknownType) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType instanceof IntegerType) && ((! (divisor instanceof IntConstant)) || (((IntConstant) divisor).equals(INT_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType == LongType.v()) && ((! (divisor instanceof LongConstant)) || (((LongConstant) divisor).equals(LONG_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } caseBinopExpr(expr); }
/** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:42 */ public static soot.Value emitConstant(int i) { return IntConstant.v(i); } /**
public void caseNewArrayExpr(NewArrayExpr expr) { if (expr.getBaseType() instanceof RefLikeType) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); } Value count = expr.getSize(); if ((! (count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO) .equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); }
public static IntConstant v(int value) { return new IntConstant(value); }
private void caseBinopDivExpr(BinopExpr expr) { // Factors out code common to caseDivExpr and caseRemExpr. // The checks against constant divisors would perhaps be // better performed in a later pass, post-constant-propagation. Value divisor = expr.getOp2(); Type divisorType = divisor.getType(); if (divisorType instanceof UnknownType) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType instanceof IntegerType) && ((! (divisor instanceof IntConstant)) || (((IntConstant) divisor).equals(INT_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } else if ((divisorType == LongType.v()) && ((! (divisor instanceof LongConstant)) || (((LongConstant) divisor).equals(LONG_CONSTANT_ZERO)))) { result = result.add(mgr.ARITHMETIC_EXCEPTION); } caseBinopExpr(expr); }
/** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:45 */ public static soot.Value emitConstant(boolean b) { return soot.jimple.IntConstant.v(b ? 1 : 0); } /**
public void caseNewMultiArrayExpr(NewMultiArrayExpr expr) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); for (int i = 0; i < expr.getSizeCount(); i++) { Value count = expr.getSize(i); if ((! (count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO) .equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); } }
public static IntConstant v(int value) { return new IntConstant(value); }
private Value fixNullConstant(Value potentialNullConstant) { /* * The bytecode spec says: "In terms of bitwise representation, (Object) null == (int) 0." So use an IntConstant(0) for * null comparison in if-*z opcodes. */ if (potentialNullConstant instanceof NullConstant) { return IntConstant.v(0); } return potentialNullConstant; }
public void caseNewArrayExpr(NewArrayExpr expr) { if (expr.getBaseType() instanceof RefLikeType) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); } Value count = expr.getSize(); if ((! (count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO) .equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); }
@Override public IntConstant getConstant() { return IntConstant.v(value); }
public void caseNewMultiArrayExpr(NewMultiArrayExpr expr) { result = result.add(mgr.RESOLVE_CLASS_ERRORS); for (int i = 0; i < expr.getSizeCount(); i++) { Value count = expr.getSize(i); if ((! (count instanceof IntConstant)) || (((IntConstant) count).lessThan(INT_CONSTANT_ZERO) .equals(INT_CONSTANT_ZERO))) { result = result.add(mgr.NEGATIVE_ARRAY_SIZE_EXCEPTION); } result = result.add(mightThrow(count)); } }
public Value createJimpleConstantValue(cp_info[] constant_pool) { return IntConstant.v((int) bytes); } }
public NumericConstant negate() { return IntConstant.v(-(this.value)); }