summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-03 17:17:27 +0100
committer zaaarf <zaaarf@proton.me>2023-03-03 17:17:53 +0100
commit9ec77a95e02ad18811ea8ac246f7b4887275e8fd (patch)
tree324aa2501c06dcc3a71967abd04a406e19947f4b /src
parent054fec4150861c6f1c7f250ba57b24a8c19481ee (diff)
fix: fixed breaking bug in find method0.3.1
Diffstat (limited to 'src')
-rw-r--r--src/main/java/ftbsc/lll/tools/PatternMatcher.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/ftbsc/lll/tools/PatternMatcher.java b/src/main/java/ftbsc/lll/tools/PatternMatcher.java
index 1b7d567..79539df 100644
--- a/src/main/java/ftbsc/lll/tools/PatternMatcher.java
+++ b/src/main/java/ftbsc/lll/tools/PatternMatcher.java
@@ -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!");