From 592e38066fb325d2412c914369df1d4aa5c1c09c Mon Sep 17 00:00:00 2001 From: zaaarf Date: Mon, 13 Mar 2023 02:21:33 +0100 Subject: fix: bug in insnsequence creation --- src/main/java/ftbsc/lll/tools/InsnSequence.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 5932fcd..ae9bef0 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -38,9 +38,11 @@ public class InsnSequence extends InsnList { public InsnSequence(AbstractInsnNode startNode, AbstractInsnNode endNode) { Objects.requireNonNull(startNode); Objects.requireNonNull(endNode); - for(; startNode != endNode && startNode != null; startNode = startNode.getNext()) + for(; startNode != null; startNode = startNode.getNext()) { this.add(startNode); - if (startNode == null) + if(startNode == endNode) break; + } + if(startNode == null) throw new InstructionMismatchException("Nodes" + getFirst() + " and " + getLast() + " are not connected."); } -- cgit v1.2.3-56-ga3b1