Package qilin.core.pag
Class MethodPAG
java.lang.Object
qilin.core.pag.MethodPAG
Part of a pointer assignment graph for a single method.
- Author:
- Ondrej Lhotak
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PointerAnalysisConfigprotected MethodNodeFactoryprotected final PTASceneEvery statement of this method that may raise an exception which the pointer analysis tracks (an explicitthrow, or a call whose callee may let one escape), mapped to the handlers that are in scope for it: caught exception type -> the handler's first statement. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddCallStmt(InvokableStmt unit) voidaddExceptionEdge(PagNode from, PagNode to) voidaddInternalEdge(PagNode src, PagNode dst) protected voidvoidaddTriggeredClinit(SootMethod clinit) protected voidbuild()protected voidCollects this method's throw sites and the catch handlers in scope for each of them intostmt2Handlers, from whichSolver.recordThrowStmts()creates the throw sites andExceptionHandler.dispatch()routes each thrown object to a handler.protected void
-
Field Details
-
body
-
nodeFactory
-
ptaScene
-
config
-
stmt2Handlers
Every statement of this method that may raise an exception which the pointer analysis tracks (an explicitthrow, or a call whose callee may let one escape), mapped to the handlers that are in scope for it: caught exception type -> the handler's first statement. A statement with no enclosingtryis still registered, with an empty map - membership in this map is what makes a statement a throw site forSolver.recordThrowStmts, and an uncaught throw still has to reachMethodNodeFactory.caseMethodThrow(). Only filled whenPointerAnalysisConfig.isPreciseExceptions()is set; seebuildException().
-
-
Constructor Details
-
MethodPAG
-
-
Method Details
-
getMethod
-
nodeFactory
-
getInvokeStmts
-
addCallStmt
-
build
protected void build() -
buildNormal
protected void buildNormal() -
buildException
protected void buildException()Collects this method's throw sites and the catch handlers in scope for each of them intostmt2Handlers, from whichSolver.recordThrowStmts()creates the throw sites andExceptionHandler.dispatch()routes each thrown object to a handler.We use the same logic as doop (library/exceptions/precise.logic): only explicit
throws and exceptions propagated out of callees are modelled, never implicit ones (NPE, ArrayIndexOutOfBounds, ...).Unlike Soot, SootUp has no ordered exception table to read back: traps are stored in the block graph as
ControlFlowGraph.exceptionalSuccessors(Stmt), an unordered map keyed by caught type. Handler priority is therefore re-derived at dispatch time by preferring the most specific matching type, which reproduces the bytecode order for handlers of onetry(Java rejects catching a subtype after its supertype there). -
addMiscEdges
protected void addMiscEdges() -
addInternalEdge
-
getInternalReader
-
addTriggeredClinit
-
triggeredClinits
-
addExceptionEdge
-
getExceptionEdges
-