use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SymbolicHeap method getStaticField.
public RealValue getStaticField(String owner, String name, double conc_value) {
FieldKey k = new FieldKey(owner, name);
RealValue symb_value = (RealValue) symb_static_fields.get(k);
if (symb_value == null || ((Double) symb_value.getConcreteValue()).doubleValue() != conc_value) {
symb_value = ExpressionFactory.buildNewRealConstant(conc_value);
symb_static_fields.remove(k);
}
return symb_value;
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SymbolicFunctionVM method CALL_RESULT.
@Override
public void CALL_RESULT(float conc_ret_val, String owner, String name, String desc) {
if (functionUnderExecution != null) {
if (!functionUnderExecution.getOwner().equals(owner) || !functionUnderExecution.getName().equals(name) || !functionUnderExecution.getDesc().equals(desc)) {
functionUnderExecution = null;
}
}
if (functionUnderExecution != null) {
RealValue symb_ret_val = this.env.topFrame().operandStack.peekFp32();
functionUnderExecution.setReturnValue(conc_ret_val, symb_ret_val);
RealValue new_symb_ret_val = (RealValue) functionUnderExecution.executeFunction();
this.replaceTopFp32(new_symb_ret_val);
}
functionUnderExecution = null;
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SymbolicFunctionVM method CALL_RESULT.
@Override
public void CALL_RESULT(double conc_ret_val, String owner, String name, String desc) {
if (functionUnderExecution != null) {
if (!functionUnderExecution.getOwner().equals(owner) || !functionUnderExecution.getName().equals(name) || !functionUnderExecution.getDesc().equals(desc)) {
functionUnderExecution = null;
}
}
if (functionUnderExecution != null) {
RealValue symb_ret_val = this.env.topFrame().operandStack.peekFp64();
functionUnderExecution.setReturnValue(conc_ret_val, symb_ret_val);
RealValue new_symb_ret_val = (RealValue) functionUnderExecution.executeFunction();
this.replaceTopFp64(new_symb_ret_val);
}
functionUnderExecution = null;
}
use of org.evosuite.symbolic.expr.fp.RealValue in project evosuite by EvoSuite.
the class SymbolicFunctionVM method CALLER_STACK_PARAM.
@Override
public void CALLER_STACK_PARAM(int nr, int calleeLocalsIndex, float conc_arg) {
if (functionUnderExecution != null) {
RealValue symb_arg = getRealExprFromStack(nr);
functionUnderExecution.setParam(nr, conc_arg, symb_arg);
beforeExecuteFunction(nr);
}
}
use of org.evosuite.symbolic.expr.fp.RealValue 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);
}
Aggregations