public class AliasingTransfer extends CFTransfer
The RHS always loses its type refinement (it is widened to @MaybeAliased, and its declared type must have been @MaybeAliased) except in the following cases:
analysis, sequentialSemantics
Constructor and Description |
---|
AliasingTransfer(CFAbstractAnalysis<CFValue,CFStore,CFTransfer> analysis) |
Modifier and Type | Method and Description |
---|---|
protected void |
processPostconditions(MethodInvocationNode n,
CFStore store,
ExecutableElement methodElement,
Tree tree)
Handling pseudo-assignments.
|
TransferResult<CFValue,CFStore> |
visitAssignment(AssignmentNode n,
TransferInput<CFValue,CFStore> in)
Case 1: For every assignment, the LHS is refined if the RHS has type @Unique and is
a method invocation or a new class instance.
|
TransferResult<CFValue,CFStore> |
visitMethodInvocation(MethodInvocationNode n,
TransferInput<CFValue,CFStore> in)
Case 3: Given a method invocation expression, if the parent of the expression is not a
statement, check if there are any arguments of the method call annotated as
@LeakedToResult and remove it from the store, since it might be leaked.
|
addInformationFromPreconditions, createTransferResult, finishValue, finishValue, getNarrowedValue, getValueFromFactory, getValueWithSameAnnotations, getWidenedValue, initialStore, insertIntoStores, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, recreateTransferResult, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, usesSequentialSemantics, visitArrayAccess, visitCase, visitClassName, visitConditionalNot, visitEqualTo, visitFieldAccess, visitInstanceOf, visitLambdaResultExpression, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitObjectCreation, visitReturn, visitStringConcatenateAssignment, visitStringConversion, visitTernaryExpression, visitThis, visitVariableDeclaration, visitWideningConversion
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift, visitValueLiteral
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitClassDeclaration, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThis, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThis, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitPackageName, visitParameterizedType, visitPrimitiveType, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift
public AliasingTransfer(CFAbstractAnalysis<CFValue,CFStore,CFTransfer> analysis)
public TransferResult<CFValue,CFStore> visitAssignment(AssignmentNode n, TransferInput<CFValue,CFStore> in)
visitAssignment
in interface NodeVisitor<TransferResult<CFValue,CFStore>,TransferInput<CFValue,CFStore>>
visitAssignment
in class CFAbstractTransfer<CFValue,CFStore,CFTransfer>
protected void processPostconditions(MethodInvocationNode n, CFStore store, ExecutableElement methodElement, Tree tree)
CFAbstractTransfer.visitMethodInvocation()
.
Case 2: Given a method call, traverses all formal parameters of the method declaration, and
if it doesn't have the @NonLeaked or @LeakedToResult annotations, we
remove the node of the respective argument in the method call from the store. If parameter has
@LeakedToResult, visitMethodInvocation()
handles it.
processPostconditions
in class CFAbstractTransfer<CFValue,CFStore,CFTransfer>
n
- a method callstore
- a store; is side-effected by this methodmethodElement
- the method being calledtree
- the tree for the method callpublic TransferResult<CFValue,CFStore> visitMethodInvocation(MethodInvocationNode n, TransferInput<CFValue,CFStore> in)
visitMethodInvocation
in interface NodeVisitor<TransferResult<CFValue,CFStore>,TransferInput<CFValue,CFStore>>
visitMethodInvocation
in class CFAbstractTransfer<CFValue,CFStore,CFTransfer>