mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-21 23:14:51 +01:00
fix: fixed breaking bug in find method
This commit is contained in:
parent
054fec4150
commit
9ec77a95e0
1 changed files with 6 additions and 7 deletions
|
@ -86,17 +86,16 @@ public class PatternMatcher {
|
||||||
if(ignoreFrames && cur.getType() == AbstractInsnNode.FRAME) continue;
|
if(ignoreFrames && cur.getType() == AbstractInsnNode.FRAME) continue;
|
||||||
if(ignoreLineNumbers && cur.getType() == AbstractInsnNode.LINE) continue;
|
if(ignoreLineNumbers && cur.getType() == AbstractInsnNode.LINE) continue;
|
||||||
if(match == predicates.size()) {
|
if(match == predicates.size()) {
|
||||||
last = cur.getPrevious(); //it was actually the preiovus run in this case
|
last = cur.getPrevious(); //it was actually the previous run in this case
|
||||||
break;
|
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)) {
|
} else if (predicates.get(match).test(cur)) {
|
||||||
match++;
|
match++;
|
||||||
if(first == null)
|
if(first == null)
|
||||||
first = cur;
|
first = cur;
|
||||||
} else break;
|
} else match = 0;
|
||||||
}
|
|
||||||
if(first != null && last != null) {
|
|
||||||
if(reverse) return new InsnSequence(last, first);
|
|
||||||
else return new InsnSequence(first, last);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new PatternNotFoundException("Failed to find pattern!");
|
throw new PatternNotFoundException("Failed to find pattern!");
|
||||||
|
|
Loading…
Reference in a new issue