use of org.evosuite.symbolic.expr.ref.ReferenceExpression in project evosuite by EvoSuite.
the class SymbolicFunctionVM method INVOKEVIRTUAL.
@Override
public void INVOKEVIRTUAL(Object conc_receiver, String owner, String name, String desc) {
functionUnderExecution = getFunction(owner, name, desc);
if (functionUnderExecution != null) {
ReferenceExpression symb_receiver = getReceiverFromStack();
functionUnderExecution.setReceiver(conc_receiver, symb_receiver);
if (Type.getArgumentTypes(desc).length == 0) {
callBeforeExecution(functionUnderExecution);
}
}
}
use of org.evosuite.symbolic.expr.ref.ReferenceExpression in project evosuite by EvoSuite.
the class SymbolicFunctionVM method INVOKESPECIAL.
@Override
public void INVOKESPECIAL(Object conc_receiver, String owner, String name, String desc) {
functionUnderExecution = getFunction(owner, name, desc);
if (functionUnderExecution != null) {
ReferenceExpression symb_receiver = getReceiverFromStack();
functionUnderExecution.setReceiver(conc_receiver, symb_receiver);
if (Type.getArgumentTypes(desc).length == 0) {
callBeforeExecution(functionUnderExecution);
}
}
}
use of org.evosuite.symbolic.expr.ref.ReferenceExpression in project evosuite by EvoSuite.
the class CallVM method INVOKEVIRTUAL.
/**
* We get this callback right before the user code makes the corresponding
* virtual call to method className.methName(methDesc). See:
* {@link ConcolicMethodAdapter#visitMethodInsn}
*
* <p>
* The current instrumentation system only calls this version of
* INVOKEVIRTUAL for methods that take two or fewer parameters.
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc6.html#invokevirtual
*/
@Override
public void INVOKEVIRTUAL(Object conc_receiver, String className, String methName, String methDesc) {
stackParamCount = 0;
env.topFrame().invokeNeedsThis = true;
Iterator<Operand> it = env.topFrame().operandStack.iterator();
Type[] argTypes = Type.getArgumentTypes(methDesc);
for (int i = 0; i < argTypes.length; i++) {
it.next();
}
ReferenceOperand ref_operand = (ReferenceOperand) it.next();
ReferenceExpression symb_receiver = ref_operand.getReference();
env.heap.initializeReference(conc_receiver, symb_receiver);
if (nullReferenceViolation(conc_receiver, symb_receiver))
return;
String concreteClassName = conc_receiver.getClass().getName();
Method virtualMethod = methodCall(concreteClassName, methName, methDesc);
chooseReceiverType(className, conc_receiver, methDesc, virtualMethod);
}
use of org.evosuite.symbolic.expr.ref.ReferenceExpression in project evosuite by EvoSuite.
the class CallVM method METHOD_BEGIN_RECEIVER.
@Override
public void METHOD_BEGIN_RECEIVER(Object value) {
if (!env.callerFrame().weInvokedInstrumentedCode()) {
ReferenceExpression ref = env.heap.getReference(value);
env.topFrame().localsTable.setRefLocal(0, ref);
}
}
use of org.evosuite.symbolic.expr.ref.ReferenceExpression in project evosuite by EvoSuite.
the class CallVM method CALL_RESULT.
@Override
public void CALL_RESULT(Object res, String owner, String name, String desc) {
CALL_RESULT(owner, name, desc);
if (env.topFrame().weInvokedInstrumentedCode())
// RETURN already did it
return;
else {
/**
* We are returning from uninstrumented code. This is the only way
* of storing the method return value to the symbolic state.
*/
ReferenceExpression symb_ref = env.heap.getReference(res);
env.topFrame().operandStack.pushRef(symb_ref);
}
}
Aggregations