use of org.evosuite.symbolic.expr.bv.IntegerBinaryExpression in project evosuite by EvoSuite.
the class ArithmeticVM method IOR.
/**
* bitwise OR
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#ior
*/
@Override
public void IOR() {
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.IOR, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerBinaryExpression in project evosuite by EvoSuite.
the class ArithmeticVM method ISUB.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc6.html#isub
*/
@Override
public void ISUB() {
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.MINUS, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerBinaryExpression in project evosuite by EvoSuite.
the class ArithmeticVM method LOR.
/**
* @see http
* ://java.sun.com/docs/books/jvms/second_edition/html/Instructions2
* .doc8.html#lor
*/
@Override
public void LOR() {
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.IOR, right, (long) con);
env.topFrame().operandStack.pushBv64(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerBinaryExpression in project evosuite by EvoSuite.
the class ArithmeticVM method IXOR.
/**
* bitwise XOR
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#ixor
*/
@Override
public void IXOR() {
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.IXOR, right, (long) con);
env.topFrame().operandStack.pushBv32(intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerBinaryExpression in project evosuite by EvoSuite.
the class TestIntegerSearch method sub.
private static IntegerValue sub(IntegerValue left, IntegerValue right) {
int left_val = left.getConcreteValue().intValue();
int right_val = right.getConcreteValue().intValue();
return new IntegerBinaryExpression(left, Operator.MINUS, right, (long) left_val - right_val);
}
Aggregations