summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
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.");
}