mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-25 08:54:48 +01:00
fix: out of bounds, test size first
This commit is contained in:
parent
483b111259
commit
cf11af60d7
1 changed files with 4 additions and 4 deletions
|
@ -85,13 +85,13 @@ public class PatternMatcher {
|
||||||
if(ignoreLabels && cur.getType() == AbstractInsnNode.LABEL) continue;
|
if(ignoreLabels && cur.getType() == AbstractInsnNode.LABEL) continue;
|
||||||
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(predicates.get(match).test(cur)) {
|
if(match == predicates.size()) {
|
||||||
|
last = cur.getPrevious(); //it was actually the preiovus run in this case
|
||||||
|
break;
|
||||||
|
} else if (predicates.get(match).test(cur)) {
|
||||||
match++;
|
match++;
|
||||||
if(first == null)
|
if(first == null)
|
||||||
first = cur;
|
first = cur;
|
||||||
} else if(match == predicates.size()) {
|
|
||||||
last = cur.getPrevious(); //it was actually the preiovus run in this case
|
|
||||||
break;
|
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
if(first != null && last != null) {
|
if(first != null && last != null) {
|
||||||
|
|
Loading…
Reference in a new issue