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 aSetAbstractState
of taints for taint analysis or aValueAbstractState
for 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>
ThisAbstractState
consists of aBamLocationDependentJvmMemoryLocation
with 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 class
JvmMemoryLocationAbstractState.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 void
addSourceLocation(BamLocationDependentJvmMemoryLocation<ContentT> sourceLocation)
Adds a source location to the source set.boolean
callStackContains(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.boolean
equals(java.lang.Object obj)
BamLocationDependentJvmMemoryLocation<ContentT>
getLocationDependentMemoryLocation()
JvmCfaNode
getProgramLocation()
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.int
hashCode()
boolean
isLessOrEqual(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.void
setProgramLocation(JvmCfaNode programLocation)
Sets the program location.void
setSourceReachedSet(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 aJvmMemoryLocationAbstractState
with empty source locations and call stack.- Parameters:
locationDependentMemoryLocation
- aJvmMemoryLocation
in a specified program location coming from a specific reached set.
-
JvmMemoryLocationAbstractState
public JvmMemoryLocationAbstractState(JvmMemoryLocation memoryLocation, JvmCfaNode programLocation, ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet)
Create aJvmMemoryLocationAbstractState
with 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 aJvmMemoryLocationAbstractState
with 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 aJvmMemoryLocationAbstractState
with 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 aJvmMemoryLocationAbstractState
with 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:AbstractState
Computes a join over itself and another abstract stateabstractState
(i.e., finds the least upper bound on the semilattice).- Specified by:
join
in interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
isLessOrEqual
public boolean isLessOrEqual(JvmMemoryLocationAbstractState<ContentT> abstractState)
Description copied from interface:AbstractState
Compares itself to theabstractState
(i.e., compare the states on the partial order provided by the domain of the analysis).- Specified by:
isLessOrEqual
in interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
getProgramLocation
public JvmCfaNode getProgramLocation()
Description copied from interface:ProgramLocationDependent
Returns the program location.- Specified by:
getProgramLocation
in interfaceProgramLocationDependent
-
setProgramLocation
public void setProgramLocation(JvmCfaNode programLocation)
Description copied from interface:ProgramLocationDependent
Sets the program location.- Specified by:
setProgramLocation
in interfaceProgramLocationDependent
-
getSourceReachedSet
public ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> getSourceReachedSet()
Description copied from interface:BamLocationDependent
Returns the reached set the abstract state belongs to.- Specified by:
getSourceReachedSet
in interfaceBamLocationDependent<ContentT extends AbstractState<ContentT>>
-
setSourceReachedSet
public void setSourceReachedSet(ProgramLocationDependentReachedSet<JvmAbstractState<ContentT>> sourceReachedSet)
Description copied from interface:BamLocationDependent
Sets the reached set the abstract state belongs to.- Specified by:
setSourceReachedSet
in 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:AbstractState
Creates a copy of itself.- Specified by:
copy
in interfaceAbstractState<ContentT extends AbstractState<ContentT>>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceAbstractState<ContentT extends AbstractState<ContentT>>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceAbstractState<ContentT extends AbstractState<ContentT>>
- Overrides:
hashCode
in 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 aSetAbstractState
of taints for taint analysis or aValueAbstractState
for value analysis.
-
-