public class AliasingTransfer extends CFTransfer
1.The RHS is a fresh expression.
2.The LHS is a @NonLeaked formal parameter and the RHS is an argument in a method call or constructor invocation.
3.The LHS is a @LeakedToResult formal parameter, the RHS is an argument in a method call or constructor invocation, and the method's return value is discarded.
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, finishValue, finishValue, getTypeFactoryOfSubchecker, getValueFromFactory, getValueWithSameAnnotations, initialStore, isNotFullyInitializedReceiver, moreSpecificValue, processCommonAssignment, processConditionalPostconditions, setFixedInitialStore, splitAssignments, strengthenAnnotationOfEqualTo, visitArrayAccess, visitCase, visitClassName, visitConditionalNot, visitEqualTo, visitFieldAccess, visitInstanceOf, visitLocalVariable, visitNarrowingConversion, visitNode, visitNotEqual, visitStringConcatenateAssignment, visitStringConversion, visitTernaryExpression, visitThisLiteral, visitVariableDeclaration, visitWideningConversionvisitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThisLiteral, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThisLiteral, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitObjectCreation, visitPackageName, visitParameterizedType, visitPrimitiveType, visitReturn, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShift, visitValueLiteralclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitArrayCreation, visitArrayType, visitAssertionError, visitBitwiseAnd, visitBitwiseComplement, visitBitwiseOr, visitBitwiseXor, visitBooleanLiteral, visitCharacterLiteral, visitConditionalAnd, visitConditionalOr, visitDoubleLiteral, visitExplicitThisLiteral, visitFloatingDivision, visitFloatingRemainder, visitFloatLiteral, visitGreaterThan, visitGreaterThanOrEqual, visitImplicitThisLiteral, visitIntegerDivision, visitIntegerLiteral, visitIntegerRemainder, visitLeftShift, visitLessThan, visitLessThanOrEqual, visitLongLiteral, visitMarker, visitMemberReference, visitMethodAccess, visitNullChk, visitNullLiteral, visitNumericalAddition, visitNumericalMinus, visitNumericalMultiplication, visitNumericalPlus, visitNumericalSubtraction, visitObjectCreation, visitPackageName, visitParameterizedType, visitPrimitiveType, visitReturn, visitShortLiteral, visitSignedRightShift, visitStringConcatenate, visitStringLiteral, visitSuper, visitSynchronized, visitThrow, visitTypeCast, visitUnsignedRightShiftpublic 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)
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>public 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>