Class SSACFGNullPointerAnalysis
java.lang.Object
com.ibm.wala.cfg.exc.intra.SSACFGNullPointerAnalysis
- All Implemented Interfaces:
ExceptionPruningAnalysis<SSAInstruction,
ISSABasicBlock>
public class SSACFGNullPointerAnalysis
extends Object
implements ExceptionPruningAnalysis<SSAInstruction,ISSABasicBlock>
-
Constructor Summary
ConstructorDescriptionSSACFGNullPointerAnalysis
(TypeReference[] ignoredExceptions, IR ir, ParameterState paramState, MethodState mState) -
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
-
SSACFGNullPointerAnalysis
public SSACFGNullPointerAnalysis(TypeReference[] ignoredExceptions, IR ir, ParameterState paramState, MethodState mState)
-
-
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,
ISSABasicBlock> - 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,
ISSABasicBlock> - 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,
ISSABasicBlock> - 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,
ISSABasicBlock> - Parameters:
bb
- Node- Returns:
- NullPointerState
-