refine hasExceptions(): return true if there are *uncaught* exceptions
This commit is contained in:
parent
8d143dbf20
commit
65b9e97ae5
|
@ -59,9 +59,10 @@ public interface ExceptionPruningAnalysis<I, T extends IBasicBlock<I>> {
|
|||
|
||||
/**
|
||||
* Returns true if the corresponding method contains instructions that may
|
||||
* throw an exception. Run compute(IPrograssMonitor) first.
|
||||
* throw an exception which is not caught in the same method.
|
||||
* Run compute(IPrograssMonitor) first.
|
||||
* @return true if the corresponding method contains instructions that may
|
||||
* throw an exception.
|
||||
* throw an exception which is not caught in the same method
|
||||
*/
|
||||
boolean hasExceptions();
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public class ExplodedCFGNullPointerAnalysis implements ExceptionPruningAnalysis<
|
|||
for (IExplodedBasicBlock bb : cfg) {
|
||||
if (bb.getInstruction() == null) continue;
|
||||
List<IExplodedBasicBlock> succ = cfg.getExceptionalSuccessors(bb);
|
||||
if (succ != null && !succ.isEmpty()) {
|
||||
if (succ != null && succ.contains(cfg.exit())) {
|
||||
hasException = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue