Class JvmMemoryLocationAbstractState<ContentT extends AbstractState<ContentT>>
- java.lang.Object
-
- proguard.analysis.cpa.jvm.domain.memory.JvmMemoryLocationAbstractState<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:
BamLocationDependent<ContentT>,AbstractState<JvmMemoryLocationAbstractState<ContentT>>,ProgramLocationDependent
public class JvmMemoryLocationAbstractState<ContentT extends AbstractState<ContentT>> extends java.lang.Object implements AbstractState<JvmMemoryLocationAbstractState<ContentT>>, ProgramLocationDependent, BamLocationDependent<ContentT>
ThisAbstractStateconsists of aBamLocationDependentJvmMemoryLocationwith a set of sources contributed into its value and the call stack that generated it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJvmMemoryLocationAbstractState.StackEntry<ContentT extends AbstractState<ContentT>>An entry of the call stack of the state.
-
Constructor Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSourceLocation(BamLocationDependentJvmMemoryLocation<ContentT> sourceLocation)Adds a source location to the source set.booleancallStackContains(MethodSignature signature)Returns true if a method is present in the call stack.JvmMemoryLocationAbstractState<ContentT>copy()Creates a copy of itself.java.util.LinkedList<JvmMemoryLocationAbstractState.StackEntry<ContentT>>copyStack()Returns a shallow copy of the call stack.booleanequals(java.lang.Object obj)BamLocationDependentJvmMemoryLocation<ContentT>getLocationDependentMemoryLocation()JvmCfaNodegetProgramLocation()Returns the program location.java.util.Set<BamLocationDependentJvmMemoryLocation<ContentT>>getSourceLocations()Returns the source set.ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>>getSourceReachedSet()Returns the reached set the abstract state belongs to.inthashCode()booleanisLessOrEqual(JvmMemoryLocationAbstractState<ContentT> abstractState)Compares itself to theabstractState(i.e., compare the states on the partial order provided by the domain of the analysis).JvmMemoryLocationAbstractState<ContentT>join(JvmMemoryLocationAbstractState<ContentT> abstractState)Computes a join over itself and another abstract stateabstractState(i.e., finds the least upper bound on the semilattice).JvmMemoryLocationAbstractState.StackEntry<ContentT>peekCallStack()Returns the information of the caller, null if the caller of the method the state belongs to is unknown.voidsetProgramLocation(JvmCfaNode programLocation)Sets the program location.voidsetSourceReachedSet(ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet)Sets the reached set the abstract state belongs to.static <ContentT extends AbstractState<ContentT>>
JvmMemoryLocationAbstractState<ContentT>top()Get the top state of the semi lattice for the given content type.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.analysis.cpa.interfaces.AbstractState
getPrecision, isLess
-
-
-
-
Constructor Detail
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(BamLocationDependentJvmMemoryLocation<ContentT> locationDependentMemoryLocation)
Create aJvmMemoryLocationAbstractStatewith empty source locations and call stack.- Parameters:
locationDependentMemoryLocation- aJvmMemoryLocationin a specified program location coming from a specific reached set.
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet)
Create aJvmMemoryLocationAbstractStatewith empty source locations and call stack.- Parameters:
memoryLocation- a memory location.programLocation- the program location of the memory location.sourceReachedSet- the reached set of the traced analysis from which the analyzed state comes from.
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet, java.util.Set<BamLocationDependentJvmMemoryLocation<ContentT>> sourceLocations)
Create aJvmMemoryLocationAbstractStatewith empty call stack.- Parameters:
memoryLocation- a memory location.programLocation- the program location of the memory location.sourceReachedSet- the reached set of the traced analysis from which the analyzed state comes from.sourceLocations- the succcessor memory locations.
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet, java.util.LinkedList<JvmMemoryLocationAbstractState.StackEntry<ContentT>> callStack)
Create aJvmMemoryLocationAbstractStatewith empty source locations.- Parameters:
memoryLocation- a memory location.programLocation- the program location of the memory location.sourceReachedSet- the reached set of the traced analysis from which the analyzed state comes from.callStack- the call stack.
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet, java.util.Set<BamLocationDependentJvmMemoryLocation<ContentT>> sourceLocations, java.util.LinkedList<JvmMemoryLocationAbstractState.StackEntry<ContentT>> callStack)
Create aJvmMemoryLocationAbstractStatewith source locations.- Parameters:
memoryLocation- a memory location.programLocation- the program location of the memory location.sourceReachedSet- the reached set of the traced analysis from which the analyzed state comes from.sourceLocations- the succcessor memory locations.callStack- the call stack.
-
-
Method Detail
-
getLocationDependentMemoryLocation
public BamLocationDependentJvmMemoryLocation<ContentT> getLocationDependentMemoryLocation()
-
peekCallStack
public JvmMemoryLocationAbstractState.StackEntry<ContentT> peekCallStack()
Returns the information of the caller, null if the caller of the method the state belongs to is unknown.
-
callStackContains
public boolean callStackContains(MethodSignature signature)
Returns true if a method is present in the call stack.
-
copyStack
public java.util.LinkedList<JvmMemoryLocationAbstractState.StackEntry<ContentT>> copyStack()
Returns a shallow copy of the call stack.
-
join
public JvmMemoryLocationAbstractState<ContentT> join(JvmMemoryLocationAbstractState<ContentT> abstractState)
Description copied from interface:AbstractStateComputes a join over itself and another abstract stateabstractState(i.e., finds the least upper bound on the semilattice).- Specified by:
joinin interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
isLessOrEqual
public boolean isLessOrEqual(JvmMemoryLocationAbstractState<ContentT> abstractState)
Description copied from interface:AbstractStateCompares itself to theabstractState(i.e., compare the states on the partial order provided by the domain of the analysis).- Specified by:
isLessOrEqualin interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
getProgramLocation
public JvmCfaNode getProgramLocation()
Description copied from interface:ProgramLocationDependentReturns the program location.- Specified by:
getProgramLocationin interfaceProgramLocationDependent
-
setProgramLocation
public void setProgramLocation(JvmCfaNode programLocation)
Description copied from interface:ProgramLocationDependentSets the program location.- Specified by:
setProgramLocationin interfaceProgramLocationDependent
-
getSourceReachedSet
public ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> getSourceReachedSet()
Description copied from interface:BamLocationDependentReturns the reached set the abstract state belongs to.- Specified by:
getSourceReachedSetin interfaceBamLocationDependent<ContentT extends AbstractState<ContentT>>
-
setSourceReachedSet
public void setSourceReachedSet(ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet)
Description copied from interface:BamLocationDependentSets the reached set the abstract state belongs to.- Specified by:
setSourceReachedSetin interfaceBamLocationDependent<ContentT extends AbstractState<ContentT>>
-
addSourceLocation
public void addSourceLocation(BamLocationDependentJvmMemoryLocation<ContentT> sourceLocation)
Adds a source location to the source set.
-
getSourceLocations
public java.util.Set<BamLocationDependentJvmMemoryLocation<ContentT>> getSourceLocations()
Returns the source set.
-
copy
public JvmMemoryLocationAbstractState<ContentT> copy()
Description copied from interface:AbstractStateCreates a copy of itself.- Specified by:
copyin interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceAbstractState<ContentT extends AbstractState<ContentT>>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceAbstractState<ContentT extends AbstractState<ContentT>>- Overrides:
hashCodein classjava.lang.Object
-
top
public static <ContentT extends AbstractState<ContentT>> JvmMemoryLocationAbstractState<ContentT> top()
Get the top state of the semi lattice for the given content type.- Type Parameters:
ContentT- The content of the jvm states. For example, this can be aSetAbstractStateof taints for taint analysis or aValueAbstractStatefor value analysis.
-
-