Class SolarModel
java.lang.Object
pascal.taie.analysis.pta.plugin.util.SolverHolder
pascal.taie.analysis.pta.plugin.util.AnalysisModelPlugin
pascal.taie.analysis.pta.plugin.reflection.SolarModel
- All Implemented Interfaces:
Plugin
Implementation of Solar, a powerful static reflection analysis.
The technique was presented in paper:
Yue Li, Tian Tan, and Jingling Xue.
Understanding and Analyzing Java Reflection.
In TOSEM 2019.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final pascal.taie.analysis.pta.plugin.reflection.MetaObjHelper
Fields inherited from class pascal.taie.analysis.pta.plugin.util.AnalysisModelPlugin
handlers, relevantVarIndexes, relevantVars
Fields inherited from class pascal.taie.analysis.pta.plugin.util.SolverHolder
csManager, emptyContext, heapModel, hierarchy, selector, solver, typeSystem
-
Method Summary
Modifier and TypeMethodDescriptionvoid
classForName
(Context context, Invoke invoke, PointsToSet nameObjs) protected void
classForNameKnown
(Context context, Invoke forName, String className) void
classGetConstructor
(Context context, Invoke invoke, PointsToSet classObjs) protected void
classGetConstructorKnown
(Context context, Invoke invoke, JClass clazz) void
classGetMethod
(Context context, Invoke invoke, PointsToSet classObjs, PointsToSet nameObjs) protected void
classGetMethodKnown
(Context context, Invoke invoke, JClass clazz, String name) void
classGetMethods
(Context context, Invoke invoke, PointsToSet classObjs) void
classNewInstance
(Context context, Invoke invoke, PointsToSet classObjs) void
collectUnsoundArrayNewInstance
(Context __, Invoke invoke, PointsToSet classObjs) void
methodInvoke
(Context context, Invoke invoke, PointsToSet mtdObjs, PointsToSet recvObjs) void
onFinish()
Invoked when pointer analysis finishes.void
onNewPointsToSet
(CSVar csVar, PointsToSet pts) Invoked when set of new objects flow to a context-sensitive variable.void
Invoked when a new reachable stmt is discovered.protected void
Methods inherited from class pascal.taie.analysis.pta.plugin.util.AnalysisModelPlugin
registerHandler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface pascal.taie.analysis.pta.plugin.Plugin
onNewCallEdge, onNewCSMethod, onNewMethod, onPhaseFinish, onStart, onUnresolvedCall, setSolver
-
Field Details
-
helper
protected final pascal.taie.analysis.pta.plugin.reflection.MetaObjHelper helper -
invokesWithLog
-
-
Method Details
-
classForName
@InvokeHandler(signature={"<java.lang.Class: java.lang.Class forName(java.lang.String)>","<java.lang.Class: java.lang.Class forName(java.lang.String,boolean,java.lang.ClassLoader)>"}, argIndexes=0) public void classForName(Context context, Invoke invoke, PointsToSet nameObjs) -
classGetConstructor
@InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Constructor getConstructor(java.lang.Class[])>","<java.lang.Class: java.lang.reflect.Constructor getDeclaredConstructor(java.lang.Class[])>"}, argIndexes=-1) public void classGetConstructor(Context context, Invoke invoke, PointsToSet classObjs) -
classGetMethod
@InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>","<java.lang.Class: java.lang.reflect.Method getDeclaredMethod(java.lang.String,java.lang.Class[])>"}, argIndexes={-1,0}) public void classGetMethod(Context context, Invoke invoke, PointsToSet classObjs, PointsToSet nameObjs) -
classGetMethods
@InvokeHandler(signature={"<java.lang.Class: java.lang.reflect.Method[] getMethods()>","<java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()>"}, argIndexes=-1) public void classGetMethods(Context context, Invoke invoke, PointsToSet classObjs) -
methodInvoke
@InvokeHandler(signature="<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>", argIndexes={-1,0}) public void methodInvoke(Context context, Invoke invoke, PointsToSet mtdObjs, PointsToSet recvObjs) -
classNewInstance
@InvokeHandler(signature="<java.lang.Class: java.lang.Object newInstance()>", argIndexes=-1) public void classNewInstance(Context context, Invoke invoke, PointsToSet classObjs) -
onNewStmt
Description copied from interface:Plugin
Invoked when a new reachable stmt is discovered.- Specified by:
onNewStmt
in interfacePlugin
- Overrides:
onNewStmt
in classAnalysisModelPlugin
- Parameters:
stmt
- new reachable stmtcontainer
- container method ofstmt
-
onNewPointsToSet
Description copied from interface:Plugin
Invoked when set of new objects flow to a context-sensitive variable.- Specified by:
onNewPointsToSet
in interfacePlugin
- Overrides:
onNewPointsToSet
in classAnalysisModelPlugin
- Parameters:
csVar
- variable whose points-to set changespts
- set of new objects
-
collectUnsoundArrayNewInstance
@InvokeHandler(signature="<java.lang.reflect.Array: java.lang.Object newInstance(java.lang.Class,int)>", argIndexes=0) public void collectUnsoundArrayNewInstance(Context __, Invoke invoke, PointsToSet classObjs) -
onFinish
public void onFinish()Description copied from interface:Plugin
Invoked when pointer analysis finishes. Pointer analysis is supposed to have been finished at this stage, thus this call back should NOT modify pointer analysis results. -
classForNameKnown
-
classGetConstructorKnown
-
classGetMethodKnown
-
registerHandlers
protected void registerHandlers()
-