fix: fixed breaking bug in find method

This commit is contained in:
zaaarf 2023-03-03 17:17:27 +01:00
parent 054fec4150
commit 9ec77a95e0
No known key found for this signature in database
GPG key ID: AD8563472FD43386

View file

@ -86,17 +86,16 @@ public class PatternMatcher {
if(ignoreFrames && cur.getType() == AbstractInsnNode.FRAME) continue;
if(ignoreLineNumbers && cur.getType() == AbstractInsnNode.LINE) continue;
if(match == predicates.size()) {
last = cur.getPrevious(); //it was actually the preiovus run in this case
break;
last = cur.getPrevious(); //it was actually the previous run in this case
if(first != null && last != null) {
if(reverse) return new InsnSequence(last, first);
else return new InsnSequence(first, last);
}
} else if (predicates.get(match).test(cur)) {
match++;
if(first == null)
first = cur;
} else break;
}
if(first != null && last != null) {
if(reverse) return new InsnSequence(last, first);
else return new InsnSequence(first, last);
} else match = 0;
}
}
throw new PatternNotFoundException("Failed to find pattern!");