use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method D2I.
@Override
public void D2I() {
RealValue realExpr = env.topFrame().operandStack.popFp64();
double doubleValue = ((Double) realExpr.getConcreteValue()).doubleValue();
IntegerValue intExpr;
int concreteValue = (int) doubleValue;
if (!realExpr.containsSymbolicVariable()) {
intExpr = ExpressionFactory.buildNewIntegerConstant(concreteValue);
} else {
intExpr = new RealToIntegerCast(realExpr, (long) concreteValue);
}
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method IAND.
/**
* bitwise AND
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#iand
*/
@Override
public void IAND() {
IntegerValue right = env.topFrame().operandStack.popBv32();
IntegerValue left = env.topFrame().operandStack.popBv32();
int left_concrete_value = ((Long) left.getConcreteValue()).intValue();
int right_concrete_value = ((Long) right.getConcreteValue()).intValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
int con = left_concrete_value & right_concrete_value;
IntegerValue intExpr = new IntegerBinaryExpression(left, Operator.IAND, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LAND.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc8.html#land
*/
@Override
public void LAND() {
IntegerValue right = env.topFrame().operandStack.popBv64();
IntegerValue left = env.topFrame().operandStack.popBv64();
long left_concrete_value = ((Long) left.getConcreteValue()).longValue();
long right_concrete_value = ((Long) right.getConcreteValue()).longValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
long con = left_concrete_value & right_concrete_value;
IntegerValue intExpr = new IntegerBinaryExpression(left, Operator.IAND, right, (long) con);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method ISHL.
/**
* Stack=value1(int)|value2(int)
*
* Pops two ints off the stack. Shifts value2 left by the amount indicated
* in the five low bits of value1. The int result is then pushed back onto
* the stack.
*/
@Override
public void ISHL() {
IntegerValue right_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
IntegerValue left_expr = (IntegerValue) env.topFrame().operandStack.popBv32();
int left_concrete_value = ((Long) left_expr.getConcreteValue()).intValue();
int right_concrete_value = ((Long) right_expr.getConcreteValue()).intValue();
int concrete_value = left_concrete_value << (right_concrete_value & 0x001F);
IntegerBinaryExpression intExpr = new IntegerBinaryExpression(left_expr, Operator.SHL, right_expr, (long) concrete_value);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method IMUL.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc6.html#imul
*/
@Override
public void IMUL() {
IntegerValue right = env.topFrame().operandStack.popBv32();
IntegerValue left = env.topFrame().operandStack.popBv32();
int left_concrete_value = ((Long) left.getConcreteValue()).intValue();
int right_concrete_value = ((Long) right.getConcreteValue()).intValue();
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
if (!right.containsSymbolicVariable()) {
right = ExpressionFactory.buildNewIntegerConstant(right_concrete_value);
}
int con = left_concrete_value * right_concrete_value;
IntegerValue intExpr = ExpressionFactory.mul(left, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
Aggregations