mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-21 23:14:51 +01:00
fix: nullptr in PatternMatcher
This commit is contained in:
parent
dd09c4f8e1
commit
05c9f6c3a2
1 changed files with 1 additions and 2 deletions
|
@ -83,11 +83,10 @@ public class PatternMatcher {
|
|||
if(predicates.size() == 0) return new InsnSequence(cur); //match whatever
|
||||
first = cur;
|
||||
last = cur;
|
||||
for(int match = 0; match < predicates.size(); last = reverse ? last.getPrevious() : last.getNext()) {
|
||||
for(int match = 0; last != null && match < predicates.size(); last = reverse ? last.getPrevious() : last.getNext()) {
|
||||
if(ignoreLabels && cur.getType() == AbstractInsnNode.LABEL) continue;
|
||||
if(ignoreFrames && cur.getType() == AbstractInsnNode.FRAME) continue;
|
||||
if(ignoreLineNumbers && cur.getType() == AbstractInsnNode.LINE) continue;
|
||||
if(last == null) break;
|
||||
if(!predicates.get(match).test(last)) break;
|
||||
if(match == predicates.size() - 1) {
|
||||
if(reverse) return new InsnSequence(last, first); //we are matching backwards
|
||||
|
|
Loading…
Reference in a new issue