Class JvmMemoryLocationTransferRelation<ContentT extends AbstractState<ContentT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.domain.memory.JvmMemoryLocationTransferRelation<ContentT>
-
- Type Parameters:
ContentT- The content of the jvm states for the traced analysis. For example, this can be aSetAbstractStateof taints for taint analysis or aValueAbstractStatefor value analysis.
- All Implemented Interfaces:
TransferRelation<JvmMemoryLocationAbstractState<ContentT>>
public class JvmMemoryLocationTransferRelation<ContentT extends AbstractState<ContentT>> extends java.lang.Object implements TransferRelation<JvmMemoryLocationAbstractState<ContentT>>
TheJvmMemoryLocationTransferRelationcomputes the backward successors of anJvmMemoryLocationAbstractStatefor a given instruction. A backward successor is a memory location which may have contributed to the value of the currentJvmMemoryLocation.The transfer relation uses a
BamCachecontaining the results of an analysis in order to calculate the successorsJvmMemoryLocationAbstractState:- If a successor is in the currently analyzed method just use the current
ProgramLocationDependentReachedSet(representing the results of the back-traced analysis for the current method call with a specific entry state). - If the current state can be the result of a method call, search for entry in the cache that
can result in the current state (i.e. from the cache entries of the called methods get the
ones that have as initial state the result of the
ReduceOperatorof the back-traced analysis for the caller abstract state and that have an exit state that results in the current state after applying theExpandOperatorof the back-traced analysis). - If the current state is located in the entry node of a method:
- If the call site was analyzed during the backward analysis the successor location will be the known caller.
- Otherwise look for all potential callers in the cache (i.e. states that call the
method and result in the current method after applying the
ReduceOperator).
The value of the successor memory location is guaranteed to be greater than the threshold (e.g. if
JvmMemoryLocationTransferRelationis aSetAbstractStatewe can set the threshold toSetAbstractState.bottomto guarantee we don't calculate a successor if the taint is not propagated anymore). Thus, the threshold defines the cut-off of the traces generated withJvmMemoryLocationTransferRelation.
-
-
Constructor Summary
Constructors Constructor Description JvmMemoryLocationTransferRelation(ContentT threshold, BamCpa<ContentT> bamCpa, java.util.Map<Call,java.util.Set<JvmMemoryLocation>> extraTaintPropagationLocations)Create a memory location transfer relation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<JvmMemoryLocationAbstractState<ContentT>>generateAbstractSuccessors(JvmMemoryLocationAbstractState<ContentT> abstractState, Precision precision)Returns abstract successor states of theabstractStateunder the selectedprecision.protected java.util.List<JvmMemoryLocation>processCall(JvmMemoryLocation memoryLocation, ConstantInstruction callInstruction, Clazz clazz, JvmCfaNode parentNode)The default implementation traces the return value back to the method arguments and the instance.
-
-
-
Constructor Detail
-
JvmMemoryLocationTransferRelation
public JvmMemoryLocationTransferRelation(ContentT threshold, BamCpa<ContentT> bamCpa, java.util.Map<Call,java.util.Set<JvmMemoryLocation>> extraTaintPropagationLocations)
Create a memory location transfer relation.- Parameters:
threshold- a cut-off thresholdbamCpa- the BAM cpa that was used to calculate the results in the cache
-
-
Method Detail
-
generateAbstractSuccessors
public java.util.Collection<JvmMemoryLocationAbstractState<ContentT>> generateAbstractSuccessors(JvmMemoryLocationAbstractState<ContentT> abstractState, Precision precision)
Description copied from interface:TransferRelationReturns abstract successor states of theabstractStateunder the selectedprecision.- Specified by:
generateAbstractSuccessorsin interfaceTransferRelation<ContentT extends AbstractState<ContentT>>
-
processCall
protected java.util.List<JvmMemoryLocation> processCall(JvmMemoryLocation memoryLocation, ConstantInstruction callInstruction, Clazz clazz, JvmCfaNode parentNode)
The default implementation traces the return value back to the method arguments and the instance. Additionally, handles extra taints' propagation if the need is identified at this call site.
-
-