diff --git a/src/main/java/soot/toolkits/graph/MHGDominatorsFinder.java b/src/main/java/soot/toolkits/graph/MHGDominatorsFinder.java index 567c0e139c0..b7211e73825 100644 --- a/src/main/java/soot/toolkits/graph/MHGDominatorsFinder.java +++ b/src/main/java/soot/toolkits/graph/MHGDominatorsFinder.java @@ -84,6 +84,9 @@ protected void doAnalysis() { BitSet self = new BitSet(); self.set(indexOf(o)); nodeToFlowSet.put(o, self); + } else if (graph.getPredsOf(o).isEmpty()) { + BitSet empty = new BitSet(); + nodeToFlowSet.put(o, empty); } else { nodeToFlowSet.put(o, fullSet); } @@ -93,7 +96,7 @@ protected void doAnalysis() { do { changed = false; for (N o : graph) { - if (heads.contains(o)) { + if (heads.contains(o) || graph.getPredsOf(o).isEmpty()) { continue; }