Class ExplodedCFGNullPointerAnalysis
java.lang.Object
com.ibm.wala.cfg.exc.intra.ExplodedCFGNullPointerAnalysis
- All Implemented Interfaces:
ExceptionPruningAnalysis<SSAInstruction,
IExplodedBasicBlock>
public class ExplodedCFGNullPointerAnalysis
extends Object
implements ExceptionPruningAnalysis<SSAInstruction,IExplodedBasicBlock>
Intraprocedural null pointer analysis for the exploded control flow graph.
- Author:
- Juergen Graf <graf@kit.edu>
-
Constructor Summary
ConstructorDescriptionExplodedCFGNullPointerAnalysis
(TypeReference[] ignoredExceptions, IR ir, ParameterState paramState, MethodState mState, boolean optHasExceptions) -
Method Summary
Modifier and TypeMethodDescriptionint
compute
(MonitorUtil.IProgressMonitor progress) Computes impossible control flow that is due to exceptions that definitely will not appear or that will always be thrown.getCFG()
Returns the result of the analysis: A control flow graph where impossible control flow has been removed.Returns the state of a node.boolean
Returns true if the corresponding method contains instructions that may throw an exception which is not caught in the same method.
-
Constructor Details
-
ExplodedCFGNullPointerAnalysis
public ExplodedCFGNullPointerAnalysis(TypeReference[] ignoredExceptions, IR ir, ParameterState paramState, MethodState mState, boolean optHasExceptions)
-
-
Method Details
-
compute
public int compute(MonitorUtil.IProgressMonitor progress) throws GraphIntegrity.UnsoundGraphException, CancelException Description copied from interface:ExceptionPruningAnalysis
Computes impossible control flow that is due to exceptions that definitely will not appear or that will always be thrown. You have to run this method before using getPruned() to extract the result of the analysis.- Specified by:
compute
in interfaceExceptionPruningAnalysis<SSAInstruction,
IExplodedBasicBlock> - Parameters:
progress
- A progress monitor that is used to display the progress of the analysis. It can also be used to detect a cancel request from the user. The common behavior is to cancel the method if progress.isCanceled() is true by throwing a CancelException.- Returns:
- Number of edges that have been removed from the cfg.
- Throws:
GraphIntegrity.UnsoundGraphException
- Thrown if the original CFG contains inconsistencies.CancelException
- Thrown if the user requested cancellation through the progress monitor.
-
getCFG
Description copied from interface:ExceptionPruningAnalysis
Returns the result of the analysis: A control flow graph where impossible control flow has been removed. The way how and which impossible flow is detected may vary between different implementations of this class. Run compute(IProgressMonitor) first.- Specified by:
getCFG
in interfaceExceptionPruningAnalysis<SSAInstruction,
IExplodedBasicBlock> - Returns:
- The improved CFG without edges that were detected as impossible flow.
-
hasExceptions
public boolean hasExceptions()Description copied from interface:ExceptionPruningAnalysis
Returns true if the corresponding method contains instructions that may throw an exception which is not caught in the same method. Run compute(IPrograssMonitor) first.- Specified by:
hasExceptions
in interfaceExceptionPruningAnalysis<SSAInstruction,
IExplodedBasicBlock> - Returns:
- true if the corresponding method contains instructions that may throw an exception which is not caught in the same method
-
getState
Description copied from interface:ExceptionPruningAnalysis
Returns the state of a node. The node has to be part of the cfg.- Specified by:
getState
in interfaceExceptionPruningAnalysis<SSAInstruction,
IExplodedBasicBlock> - Parameters:
bb
- Node- Returns:
- NullPointerState
-