use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class SymbolicFunctionVM method CALLER_STACK_PARAM.
@Override
public void CALLER_STACK_PARAM(int nr, int calleeLocalsIndex, boolean conc_arg) {
if (functionUnderExecution != null) {
IntegerValue symb_arg = getIntegerExprFromStack(nr);
functionUnderExecution.setParam(nr, conc_arg, symb_arg);
beforeExecuteFunction(nr);
}
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method IINC.
/**
* Increment i-th local (int) variable by constant (int) value
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#iinc
*/
@Override
public void IINC(int i, int value) {
IntegerConstant right = ExpressionFactory.buildNewIntegerConstant(value);
IntegerValue left = env.topFrame().localsTable.getBv32Local(i);
int left_concrete_value = ((Long) left.getConcreteValue()).intValue();
int right_concrete_value = value;
if (!left.containsSymbolicVariable()) {
left = ExpressionFactory.buildNewIntegerConstant(left_concrete_value);
}
int con = left_concrete_value + right_concrete_value;
IntegerValue intExpr = ExpressionFactory.add(left, right, (long) con);
env.topFrame().localsTable.setBv32Local(i, intExpr);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class ArithmeticVM method LADD.
/**
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc8.html#ladd
*/
@Override
public void LADD() {
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 = ExpressionFactory.add(left, 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 F2I.
@Override
public void F2I() {
RealValue realExpr = env.topFrame().operandStack.popFp32();
float doubleValue = ((Double) realExpr.getConcreteValue()).floatValue();
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 D2L.
@Override
public void D2L() {
RealValue realExpr = env.topFrame().operandStack.popFp64();
double doubleValue = ((Double) realExpr.getConcreteValue()).doubleValue();
IntegerValue intExpr;
long concreteValue = (long) doubleValue;
if (!realExpr.containsSymbolicVariable()) {
intExpr = ExpressionFactory.buildNewIntegerConstant(concreteValue);
} else {
intExpr = new RealToIntegerCast(realExpr, concreteValue);
}
env.topFrame().operandStack.pushBv64(intExpr);
}
Aggregations