class InstConstraintVisitor {
/**
* Ensures the specific preconditions of the said instruction.
*/
@Override
public void visitBASTORE(BASTORE o){
Type arrayref = stack().peek(2);
Type index = stack().peek(1);
Type value = stack().peek(0);
indexOfInt(o, index);
valueOfInt(o, value);
if (arrayrefOfArrayType(o, arrayref)){
if (! ( (((ArrayType) arrayref).getElementType().equals(Type.BOOLEAN)) ||
(((ArrayType) arrayref).getElementType().equals(Type.BYTE)) ) ) {
constraintViolated(o,
"The 'arrayref' does not refer to an array with elements of a Type.BYTE or Type.BOOLEAN but to an array of '"+
((ArrayType) arrayref).getElementType()+"'.");
}
}
}
}