diff options
author | zaaarf <zaaarf@proton.me> | 2023-04-14 01:22:48 +0200 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-04-14 01:22:48 +0200 |
commit | 8cc440017f688494ca50d0e071799c164e3640f0 (patch) | |
tree | 7cdf3a7663919fa02d5cf49920601231b07cd9d1 /src/main/java/ftbsc/lll/tools/PatternMatcher.java | |
parent | 05c9f6c3a2458ecdedbce1468b7a8cd2e0ca2b6f (diff) |
fix: should not ignore on first element of pattern0.4.2
Diffstat (limited to 'src/main/java/ftbsc/lll/tools/PatternMatcher.java')
-rw-r--r-- | src/main/java/ftbsc/lll/tools/PatternMatcher.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/ftbsc/lll/tools/PatternMatcher.java b/src/main/java/ftbsc/lll/tools/PatternMatcher.java index ff4423a..fff84db 100644 --- a/src/main/java/ftbsc/lll/tools/PatternMatcher.java +++ b/src/main/java/ftbsc/lll/tools/PatternMatcher.java @@ -84,9 +84,11 @@ public class PatternMatcher { first = cur; last = cur; 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(match != 0) { + if(ignoreLabels && last.getType() == AbstractInsnNode.LABEL) continue; + if(ignoreFrames && last.getType() == AbstractInsnNode.FRAME) continue; + if(ignoreLineNumbers && last.getType() == AbstractInsnNode.LINE) continue; + } if(!predicates.get(match).test(last)) break; if(match == predicates.size() - 1) { if(reverse) return new InsnSequence(last, first); //we are matching backwards |