Skip to content

Commit

Permalink
fix: prevent NPE while processing try/catch regions (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed May 29, 2019
1 parent d673786 commit b158858
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -954,6 +954,9 @@ public IRegion processTryCatchBlocks(MethodNode mth) {
Set<BlockNode> exits = new HashSet<>();
for (BlockNode splitter : splitters) {
for (BlockNode handler : blocks) {
if (handler.contains(AFlag.REMOVE)) {
continue;
}
List<BlockNode> s = splitter.getSuccessors();
if (s.isEmpty()) {
LOG.debug(ErrorsCounter.formatMsg(mth, "No successors for splitter: " + splitter));
Expand Down
3 changes: 3 additions & 0 deletions jadx-core/src/main/java/jadx/core/utils/BlockUtils.java
Expand Up @@ -432,6 +432,9 @@ public static BlockNode getPathCross(MethodNode mth, BlockNode b1, BlockNode b2)
if (b1 == null || b2 == null) {
return null;
}
if (b1.getDomFrontier() == null || b2.getDomFrontier() == null) {
return null;
}
BitSet b = new BitSet();
b.or(b1.getDomFrontier());
b.and(b2.getDomFrontier());
Expand Down

0 comments on commit b158858

Please sign in to comment.