Class ConstantMapStrategy
java.lang.Object
soot.jimple.infoflow.collections.strategies.containers.ConstantMapStrategy
- All Implemented Interfaces:
IContainerStrategy
- Direct Known Subclasses:
AbstractListStrategy
Strategy that only reasons about maps with constant keys
- Author:
- Tim Lange
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<soot.RefType>protected final ReadOnlyListViewAnalysisprotected final InfoflowManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(ContainerContext[] ctxt1, ContainerContext[] ctxt2) Return the union of the given contextsgetFirstPosition(soot.Value value, soot.jimple.Stmt stmt) Retrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)getIndexContext(soot.Value value, soot.jimple.Stmt stmt) Retrieves a context for a given indexgetKeyContext(soot.Value value, soot.jimple.Stmt stmt) Retrieves a context for a given keygetLastPosition(soot.Value value, soot.jimple.Stmt stmt) Retrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)getNextPosition(soot.Value value, soot.jimple.Stmt stmt) Retrieves a context given an implicit key after the given statement (i.e. a list where the key is dependent on the number of add calls before)longlongintersect(ContainerContext apKey, ContainerContext stmtKey) Checks whether the two arguments intersectbooleanisReadOnly(soot.Unit unit) Returns whether the given value is used in a read-only fashionlessThanEqual(ContainerContext ctxt1, ContainerContext ctxt2) Returns whether ctxt1 is less than ctxt2shift(ContainerContext ctxt, int n, boolean exact) Shifts the ctxt to the rightprotected booleanshouldResolveIndex(soot.Value base) Checks whether an index should be resolved.booleanshouldSmash(ContainerContext[] ctxts) Returns whether the context is still useful or not
-
Field Details
-
manager
-
itAnalysis
-
indexTypes
-
-
Constructor Details
-
ConstantMapStrategy
-
-
Method Details
-
getResolvedKeys
public long getResolvedKeys() -
getUnresolvedKeys
public long getUnresolvedKeys() -
intersect
Description copied from interface:IContainerStrategyChecks whether the two arguments intersect- Specified by:
intersectin interfaceIContainerStrategy- Parameters:
apKey- key from the access pathstmtKey- key from the statement- Returns:
- true if args fully intersects, maybe on part match and false on definitely no match
-
append
Description copied from interface:IContainerStrategyReturn the union of the given contexts- Specified by:
appendin interfaceIContainerStrategy- Parameters:
ctxt1- key from the access pathctxt2- key from the statement- Returns:
- new context definition
-
getKeyContext
Description copied from interface:IContainerStrategyRetrieves a context for a given key- Specified by:
getKeyContextin interfaceIContainerStrategy- Parameters:
value- requested valuestmt- statement containing key- Returns:
- new context definition
-
shouldResolveIndex
protected boolean shouldResolveIndex(soot.Value base) Checks whether an index should be resolved. This is a special case, where Lists and Sets share the same interface (Collection), yet we do not track Sets and thus, don't need to query the index for Sets.- Parameters:
base- base local- Returns:
- true if index should be resovled
-
getIndexContext
Description copied from interface:IContainerStrategyRetrieves a context for a given index- Specified by:
getIndexContextin interfaceIContainerStrategy- Parameters:
value- requested valuestmt- statement containing index- Returns:
- new context definition
-
getNextPosition
Description copied from interface:IContainerStrategyRetrieves a context given an implicit key after the given statement (i.e. a list where the key is dependent on the number of add calls before)- Specified by:
getNextPositionin interfaceIContainerStrategy- Parameters:
value- liststmt- statement that uses value- Returns:
- new context definition
-
getFirstPosition
Description copied from interface:IContainerStrategyRetrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)- Specified by:
getFirstPositionin interfaceIContainerStrategy- Parameters:
value- liststmt- statement that uses value- Returns:
- new context definition
-
getLastPosition
Description copied from interface:IContainerStrategyRetrieves a context given an implicit key before the given statement (i.e. a list where the key is dependent on the number of add calls before)- Specified by:
getLastPositionin interfaceIContainerStrategy- Parameters:
value- liststmt- statement that uses value- Returns:
- new context definition
-
lessThanEqual
Description copied from interface:IContainerStrategyReturns whether ctxt1 is less than ctxt2- Specified by:
lessThanEqualin interfaceIContainerStrategy- Parameters:
ctxt1- first contextctxt2- second context- Returns:
- true ctxt1 is less than ctxt2
-
shift
Description copied from interface:IContainerStrategyShifts the ctxt to the right- Specified by:
shiftin interfaceIContainerStrategy- Parameters:
ctxt- current context- Returns:
- new context definition
-
shouldSmash
Description copied from interface:IContainerStrategyReturns whether the context is still useful or not- Specified by:
shouldSmashin interfaceIContainerStrategy- Parameters:
ctxts- contexts- Returns:
- true if context contains no useful information and thus, the collection should be smashed
-
isReadOnly
public boolean isReadOnly(soot.Unit unit) Description copied from interface:IContainerStrategyReturns whether the given value is used in a read-only fashion- Specified by:
isReadOnlyin interfaceIContainerStrategy- Parameters:
unit- current statement- Returns:
- true if is read-only
-