diff options
author | ftbsc <dev@fantabos.co> | 2023-02-08 00:08:58 +0100 |
---|---|---|
committer | ftbsc <dev@fantabos.co> | 2023-02-08 00:08:58 +0100 |
commit | cf11af60d79187cf116e1ae99ec2ae1e9e702fda (patch) | |
tree | d9c06a2b2020c959e1f258fb5992bfeb75e04ce5 /src/main/java/ftbsc/lll/tools | |
parent | 483b11125941cf0659beb909163081f4dc871046 (diff) |
fix: out of bounds, test size first
Diffstat (limited to 'src/main/java/ftbsc/lll/tools')
-rw-r--r-- | src/main/java/ftbsc/lll/tools/PatternMatcher.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/ftbsc/lll/tools/PatternMatcher.java b/src/main/java/ftbsc/lll/tools/PatternMatcher.java index 0d71125..5719872 100644 --- a/src/main/java/ftbsc/lll/tools/PatternMatcher.java +++ b/src/main/java/ftbsc/lll/tools/PatternMatcher.java @@ -85,13 +85,13 @@ public class PatternMatcher { if(ignoreLabels && cur.getType() == AbstractInsnNode.LABEL) continue; if(ignoreFrames && cur.getType() == AbstractInsnNode.FRAME) 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++; if(first == null) first = cur; - } else if(match == predicates.size()) { - last = cur.getPrevious(); //it was actually the preiovus run in this case - break; } else break; } if(first != null && last != null) { |