use of org.checkerframework.framework.flow.CFValue in project checker-framework by typetools.
the class LowerBoundTransfer method visitNumericalSubtraction.
@Override
public TransferResult<CFValue, CFStore> visitNumericalSubtraction(NumericalSubtractionNode n, TransferInput<CFValue, CFStore> p) {
TransferResult<CFValue, CFStore> result = super.visitNumericalSubtraction(n, p);
AnnotationMirror newAnno = getAnnotationForMinus(n, p);
return createNewResult(result, newAnno);
}
use of org.checkerframework.framework.flow.CFValue in project checker-framework by typetools.
the class LowerBoundTransfer method visitNumericalAddition.
@Override
public TransferResult<CFValue, CFStore> visitNumericalAddition(NumericalAdditionNode n, TransferInput<CFValue, CFStore> p) {
TransferResult<CFValue, CFStore> result = super.visitNumericalAddition(n, p);
AnnotationMirror newAnno = getAnnotationForPlus(n, p);
return createNewResult(result, newAnno);
}
use of org.checkerframework.framework.flow.CFValue in project checker-framework by typetools.
the class LowerBoundTransfer method visitBitwiseAnd.
@Override
public TransferResult<CFValue, CFStore> visitBitwiseAnd(BitwiseAndNode n, TransferInput<CFValue, CFStore> p) {
TransferResult<CFValue, CFStore> transferResult = super.visitBitwiseAnd(n, p);
AnnotationMirror resultAnno = getAnnotationForAnd(n, p);
return createNewResult(transferResult, resultAnno);
}
use of org.checkerframework.framework.flow.CFValue in project checker-framework by typetools.
the class UpperBoundAnnotatedTypeFactory method fromLessThanOrEqual.
private UBQualifier fromLessThanOrEqual(Tree tree, TreePath treePath, List<String> lessThanExpressions) {
UBQualifier ubQualifier = null;
for (String expression : lessThanExpressions) {
FlowExpressions.Receiver receiver;
try {
receiver = getReceiverFromJavaExpressionString(expression, treePath);
} catch (FlowExpressionParseException e) {
receiver = null;
}
if (receiver == null || !CFAbstractStore.canInsertReceiver(receiver)) {
continue;
}
CFStore store = getStoreBefore(tree);
if (store != null) {
CFValue value = store.getValue(receiver);
if (value != null && value.getAnnotations().size() == 1) {
UBQualifier newUBQ = UBQualifier.createUBQualifier(value.getAnnotations().iterator().next());
if (ubQualifier == null) {
ubQualifier = newUBQ;
} else {
ubQualifier = ubQualifier.glb(newUBQ);
}
}
}
}
return ubQualifier;
}
use of org.checkerframework.framework.flow.CFValue in project checker-framework by typetools.
the class UpperBoundTransfer method visitFieldAccess.
/**
* If n is an array length field access, then the type of a.length is the glb
* of @LTEqLengthOf("a") and the value of a.length in the store. This is case 19.
*/
@Override
public TransferResult<CFValue, CFStore> visitFieldAccess(FieldAccessNode n, TransferInput<CFValue, CFStore> in) {
if (NodeUtils.isArrayLengthFieldAccess(n)) {
FieldAccess arrayLength = FlowExpressions.internalReprOfFieldAccess(atypeFactory, n);
Receiver arrayRec = arrayLength.getReceiver();
Tree arrayTree = n.getReceiver().getTree();
TransferResult<CFValue, CFStore> result = visitLengthAccess(n, in, arrayRec, arrayTree);
if (result != null) {
return result;
}
}
return super.visitFieldAccess(n, in);
}
Aggregations