|
|
@ -267,7 +267,9 @@ public final class DeadCodeHelper { |
|
|
|
for (BasicBlock block : range.getProtectedRange()) { |
|
|
|
for (BasicBlock block : range.getProtectedRange()) { |
|
|
|
setPreds.addAll(block.getPreds()); |
|
|
|
setPreds.addAll(block.getPreds()); |
|
|
|
} |
|
|
|
} |
|
|
|
setPreds.removeAll(range.getProtectedRange()); |
|
|
|
for (BasicBlock basicBlock : range.getProtectedRange()) { |
|
|
|
|
|
|
|
setPreds.remove(basicBlock); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(setPreds.size() != 1) { |
|
|
|
if(setPreds.size() != 1) { |
|
|
|
continue; // multiple predecessors, obfuscated range
|
|
|
|
continue; // multiple predecessors, obfuscated range
|
|
|
@ -280,8 +282,7 @@ public final class DeadCodeHelper { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
boolean monitorexit_in_range = false; |
|
|
|
boolean monitorexit_in_range = false; |
|
|
|
Set<BasicBlock> setProtectedBlocks = new HashSet<>(); |
|
|
|
Set<BasicBlock> setProtectedBlocks = new HashSet<>(range.getProtectedRange()); |
|
|
|
setProtectedBlocks.addAll(range.getProtectedRange()); |
|
|
|
|
|
|
|
setProtectedBlocks.add(range.getHandler()); |
|
|
|
setProtectedBlocks.add(range.getHandler()); |
|
|
|
|
|
|
|
|
|
|
|
for (BasicBlock block : setProtectedBlocks) { |
|
|
|
for (BasicBlock block : setProtectedBlocks) { |
|
|
@ -305,7 +306,9 @@ public final class DeadCodeHelper { |
|
|
|
for (BasicBlock block : range.getProtectedRange()) { |
|
|
|
for (BasicBlock block : range.getProtectedRange()) { |
|
|
|
setSuccs.addAll(block.getSuccs()); |
|
|
|
setSuccs.addAll(block.getSuccs()); |
|
|
|
} |
|
|
|
} |
|
|
|
setSuccs.removeAll(range.getProtectedRange()); |
|
|
|
for (BasicBlock basicBlock : range.getProtectedRange()) { |
|
|
|
|
|
|
|
setSuccs.remove(basicBlock); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(setSuccs.size() != 1) { |
|
|
|
if(setSuccs.size() != 1) { |
|
|
|
continue; // non-unique successor
|
|
|
|
continue; // non-unique successor
|
|
|
@ -461,7 +464,9 @@ public final class DeadCodeHelper { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// add exception ranges from predecessors
|
|
|
|
// add exception ranges from predecessors
|
|
|
|
setPredHandlersIntersection.removeAll(block.getSuccExceptions()); |
|
|
|
for (BasicBlock basicBlock : block.getSuccExceptions()) { |
|
|
|
|
|
|
|
setPredHandlersIntersection.remove(basicBlock); |
|
|
|
|
|
|
|
} |
|
|
|
BasicBlock predecessor = block.getPreds().get(0); |
|
|
|
BasicBlock predecessor = block.getPreds().get(0); |
|
|
|
|
|
|
|
|
|
|
|
for (BasicBlock handler : setPredHandlersIntersection) { |
|
|
|
for (BasicBlock handler : setPredHandlersIntersection) { |
|
|
|