Class ExceptionAnalysis
java.lang.Object
com.ibm.wala.analysis.exceptionanalysis.ExceptionAnalysis
This class analyzes the exceptional control flow. Use
ExceptionAnalysis2EdgeFilter
to
remove infeasible edges.
In a first step an intraprocedural analysis is performed, to collect the thrown exceptions and collect the exceptions caught, per invoke instruction. The results of the intraprocedural analysis are used for a GenKill data flow analysis on the call graph. (Each node generates intraprocedural thrown exceptions and along invoke edges, caught exceptions are removed.)
Notice: Only exceptions, which are part of the analysis scope are considered.
- Author:
- Stephan Gocht
<stephan@gobro.de>
-
Constructor Summary
ConstructorDescriptionExceptionAnalysis
(CallGraph callgraph, PointerAnalysis<InstanceKey> pointerAnalysis, ClassHierarchy cha) ExceptionAnalysis
(CallGraph callgraph, PointerAnalysis<InstanceKey> pointerAnalysis, ClassHierarchy cha, InterproceduralExceptionFilter<SSAInstruction> filter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
catchesException
(CGNode node, ISSABasicBlock throwBlock, ISSABasicBlock catchBlock) getCGNodeExceptions
(CGNode node) getExceptions
(CGNode node, SSAInstruction instruction) Returns all exceptions, which may be raised by this instruction.boolean
hasUncaughtExceptions
(CGNode node, ISSABasicBlock block) void
solve()
void
solve
(MonitorUtil.IProgressMonitor monitor)
-
Constructor Details
-
ExceptionAnalysis
public ExceptionAnalysis(CallGraph callgraph, PointerAnalysis<InstanceKey> pointerAnalysis, ClassHierarchy cha) -
ExceptionAnalysis
public ExceptionAnalysis(CallGraph callgraph, PointerAnalysis<InstanceKey> pointerAnalysis, ClassHierarchy cha, InterproceduralExceptionFilter<SSAInstruction> filter) - Parameters:
filter
- a filter to include results of other analysis (likeArrayOutOfBoundsAnalysis
orIntraproceduralNullPointerAnalysis
) or to ignore exceptions completely.
-
-
Method Details
-
solve
public void solve() -
solve
- Throws:
CancelException
-
catchesException
-
hasUncaughtExceptions
- Returns:
- if the block has uncaught exceptions
-
getExceptions
Returns all exceptions, which may be raised by this instruction. This includes exceptions from throw and invoke statements.- Returns:
- all exceptions, which may be raised by this instruction
-
getCGNodeExceptions
- Returns:
- all exceptions, which might be thrown by the method represented through the call graph node.
-
getFilter
- Returns:
- the used filter
-