Commit 2433a7e8 authored by Skylot's avatar Skylot

core: fix exception handler jumps (#320)

parent 6e358d3e
...@@ -418,8 +418,9 @@ public class BlockProcessor extends AbstractVisitor { ...@@ -418,8 +418,9 @@ public class BlockProcessor extends AbstractVisitor {
boolean change = false; boolean change = false;
for (Edge edge : edges) { for (Edge edge : edges) {
BlockNode target = edge.getTarget(); BlockNode target = edge.getTarget();
if (!target.contains(AFlag.SYNTHETIC)) { BlockNode source = edge.getSource();
BlockSplitter.insertBlockBetween(mth, edge.getSource(), target); if (!target.contains(AFlag.SYNTHETIC) && !source.contains(AFlag.SYNTHETIC)) {
BlockSplitter.insertBlockBetween(mth, source, target);
change = true; change = true;
} }
} }
......
...@@ -91,6 +91,7 @@ public class BlockSplitter extends AbstractVisitor { ...@@ -91,6 +91,7 @@ public class BlockSplitter extends AbstractVisitor {
startNew = isSplitByJump(prevInsn, insn) startNew = isSplitByJump(prevInsn, insn)
|| SEPARATE_INSNS.contains(insn.getType()) || SEPARATE_INSNS.contains(insn.getType())
|| isDoWhile(blocksMap, curBlock, insn) || isDoWhile(blocksMap, curBlock, insn)
|| insn.contains(AType.EXC_HANDLER)
|| prevInsn.contains(AFlag.TRY_LEAVE) || prevInsn.contains(AFlag.TRY_LEAVE)
|| prevInsn.getType() == InsnType.MOVE_EXCEPTION; || prevInsn.getType() == InsnType.MOVE_EXCEPTION;
if (startNew) { if (startNew) {
......
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