summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-13 02:21:33 +0100
committer zaaarf <zaaarf@proton.me>2023-03-13 02:21:33 +0100
commit592e38066fb325d2412c914369df1d4aa5c1c09c (patch)
treebb9a057bcadc1de083d7b9478a2496dd1a22ccfe /src/main/java
parent850d325ee69318e1d78fab84d08a46166a9fd70e (diff)
fix: bug in insnsequence creation
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/ftbsc/lll/tools/InsnSequence.java6
1 files 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.");
}