Commit b1588583 authored by Skylot's avatar Skylot

fix: prevent NPE while processing try/catch regions (#673)

parent d6737860
...@@ -954,6 +954,9 @@ public class RegionMaker { ...@@ -954,6 +954,9 @@ public class RegionMaker {
Set<BlockNode> exits = new HashSet<>(); Set<BlockNode> exits = new HashSet<>();
for (BlockNode splitter : splitters) { for (BlockNode splitter : splitters) {
for (BlockNode handler : blocks) { for (BlockNode handler : blocks) {
if (handler.contains(AFlag.REMOVE)) {
continue;
}
List<BlockNode> s = splitter.getSuccessors(); List<BlockNode> s = splitter.getSuccessors();
if (s.isEmpty()) { if (s.isEmpty()) {
LOG.debug(ErrorsCounter.formatMsg(mth, "No successors for splitter: " + splitter)); LOG.debug(ErrorsCounter.formatMsg(mth, "No successors for splitter: " + splitter));
......
...@@ -432,6 +432,9 @@ public class BlockUtils { ...@@ -432,6 +432,9 @@ public class BlockUtils {
if (b1 == null || b2 == null) { if (b1 == null || b2 == null) {
return null; return null;
} }
if (b1.getDomFrontier() == null || b2.getDomFrontier() == null) {
return null;
}
BitSet b = new BitSet(); BitSet b = new BitSet();
b.or(b1.getDomFrontier()); b.or(b1.getDomFrontier());
b.and(b2.getDomFrontier()); b.and(b2.getDomFrontier());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment