core: fix exception handler jumps (#320)

This commit is contained in:
Skylot
2018-07-28 22:09:29 +03:00
parent 6e358d3eab
commit 2433a7e89c
2 changed files with 4 additions and 2 deletions
@@ -418,8 +418,9 @@ public class BlockProcessor extends AbstractVisitor {
boolean change = false;
for (Edge edge : edges) {
BlockNode target = edge.getTarget();
if (!target.contains(AFlag.SYNTHETIC)) {
BlockSplitter.insertBlockBetween(mth, edge.getSource(), target);
BlockNode source = edge.getSource();
if (!target.contains(AFlag.SYNTHETIC) && !source.contains(AFlag.SYNTHETIC)) {
BlockSplitter.insertBlockBetween(mth, source, target);
change = true;
}
}
@@ -91,6 +91,7 @@ public class BlockSplitter extends AbstractVisitor {
startNew = isSplitByJump(prevInsn, insn)
|| SEPARATE_INSNS.contains(insn.getType())
|| isDoWhile(blocksMap, curBlock, insn)
|| insn.contains(AType.EXC_HANDLER)
|| prevInsn.contains(AFlag.TRY_LEAVE)
|| prevInsn.getType() == InsnType.MOVE_EXCEPTION;
if (startNew) {