mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-21 15:04:50 +01:00
fix: bug in insnsequence creation
This commit is contained in:
parent
850d325ee6
commit
592e38066f
1 changed files with 4 additions and 2 deletions
|
@ -38,9 +38,11 @@ public class InsnSequence extends InsnList {
|
||||||
public InsnSequence(AbstractInsnNode startNode, AbstractInsnNode endNode) {
|
public InsnSequence(AbstractInsnNode startNode, AbstractInsnNode endNode) {
|
||||||
Objects.requireNonNull(startNode);
|
Objects.requireNonNull(startNode);
|
||||||
Objects.requireNonNull(endNode);
|
Objects.requireNonNull(endNode);
|
||||||
for(; startNode != endNode && startNode != null; startNode = startNode.getNext())
|
for(; startNode != null; startNode = startNode.getNext()) {
|
||||||
this.add(startNode);
|
this.add(startNode);
|
||||||
if (startNode == null)
|
if(startNode == endNode) break;
|
||||||
|
}
|
||||||
|
if(startNode == null)
|
||||||
throw new InstructionMismatchException("Nodes" + getFirst() + " and " + getLast() + " are not connected.");
|
throw new InstructionMismatchException("Nodes" + getFirst() + " and " + getLast() + " are not connected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue