use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class HeapVM method LASTORE.
@Override
public void LASTORE(Object conc_array, int conc_index) {
// get symbolic arguments
IntegerValue symb_value = env.topFrame().operandStack.popBv64();
IntegerValue symb_index = env.topFrame().operandStack.popBv32();
ReferenceExpression array_ref = env.topFrame().operandStack.popRef();
/* check reference initialization */
env.heap.initializeReference(conc_array, array_ref);
/* null-check */
if (nullReferenceViolation(array_ref, conc_array)) {
return;
}
/* negative index */
if (negativeIndexViolation(conc_index, symb_index)) {
return;
}
/* out of bound index */
ReferenceExpression symb_array = array_ref;
int conc_array_length = Array.getLength(conc_array);
IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array, conc_array_length);
if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length))
return;
env.heap.array_store(conc_array, symb_array, conc_index, symb_value);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class HeapVM method DASTORE.
@Override
public void DASTORE(Object conc_array, int conc_index) {
// get symbolic arguments
RealValue symb_value = env.topFrame().operandStack.popFp64();
IntegerValue symb_index = env.topFrame().operandStack.popBv32();
ReferenceExpression array_ref = env.topFrame().operandStack.popRef();
/* check reference initialization */
env.heap.initializeReference(conc_array, array_ref);
/* null-check */
if (nullReferenceViolation(array_ref, conc_array)) {
return;
}
/* negative index */
if (negativeIndexViolation(conc_index, symb_index)) {
return;
}
/* out of bound index */
ReferenceExpression symb_array = array_ref;
int conc_array_length = Array.getLength(conc_array);
IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array, conc_array_length);
if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length))
return;
env.heap.array_store(conc_array, symb_array, conc_index, symb_value);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class HeapVM method DALOAD.
/**
* Load double from array
*
* ..., arrayref, index ==> ..., value
*
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.
* doc3.html#daload
*/
@Override
public void DALOAD(Object conc_array, int conc_index) {
// pop symbolic arguments
IntegerValue symb_index = env.topFrame().operandStack.popBv32();
ReferenceExpression array_ref = env.topFrame().operandStack.popRef();
/* check reference initialization */
env.heap.initializeReference(conc_array, array_ref);
/* null-check */
if (nullReferenceViolation(array_ref, conc_array)) {
return;
}
/* negative index */
if (negativeIndexViolation(conc_index, symb_index)) {
return;
}
/* out of bound index */
ReferenceExpression symb_array = (ReferenceExpression) array_ref;
int conc_array_length = Array.getLength(conc_array);
IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array, conc_array_length);
if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length))
return;
double fp64 = Array.getDouble(conc_array, conc_index);
RealValue c = env.heap.array_load(symb_array, conc_index, (double) fp64);
env.topFrame().operandStack.pushFp64(c);
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class HeapVM method AASTORE.
/**
* http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.doc
* .html#aastore
*/
@Override
public void AASTORE(Object conc_array, int conc_index) {
// pop arguments
@SuppressWarnings("unused") ReferenceExpression value_ref = env.topFrame().operandStack.popRef();
IntegerValue symb_index = env.topFrame().operandStack.popBv32();
ReferenceExpression array_ref = env.topFrame().operandStack.popRef();
/* check reference initialization */
env.heap.initializeReference(conc_array, array_ref);
/* null-check */
if (nullReferenceViolation(array_ref, conc_array)) {
return;
}
/* negative index */
if (negativeIndexViolation(conc_index, symb_index)) {
return;
}
/* out of bound index */
ReferenceExpression symb_array = array_ref;
int conc_array_length = Array.getLength(conc_array);
IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array, conc_array_length);
if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length))
return;
// NonNullReference are not stored in the symbolic heap fields
return;
}
use of org.evosuite.symbolic.expr.bv.IntegerValue in project evosuite by EvoSuite.
the class HeapVM method LALOAD.
@Override
public void LALOAD(Object conc_array, int conc_index) {
// pop symbolic arguments
IntegerValue symb_index = env.topFrame().operandStack.popBv32();
ReferenceExpression array_ref = env.topFrame().operandStack.popRef();
/* check reference initialization */
env.heap.initializeReference(conc_array, array_ref);
/* null-check */
if (nullReferenceViolation(array_ref, conc_array)) {
return;
}
/* negative index */
if (negativeIndexViolation(conc_index, symb_index)) {
return;
}
/* out of bound index */
ReferenceExpression symb_array = (ReferenceExpression) array_ref;
int conc_array_length = Array.getLength(conc_array);
IntegerValue symb_array_length = env.heap.getField("", ARRAY_LENGTH, conc_array, symb_array, conc_array_length);
if (indexTooBigViolation(conc_index, symb_index, conc_array_length, symb_array_length))
return;
long bv64 = Array.getLong(conc_array, conc_index);
IntegerValue c = env.heap.array_load(symb_array, conc_index, (long) bv64);
env.topFrame().operandStack.pushBv64(c);
}
Aggregations