summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ftbsc')
-rw-r--r--src/main/java/ftbsc/lll/tools/InsnSequence.java4
-rw-r--r--src/main/java/ftbsc/lll/tools/PatternMatcher.java8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java
index ae9bef0..d00292e 100644
--- a/src/main/java/ftbsc/lll/tools/InsnSequence.java
+++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java
@@ -58,7 +58,7 @@ public class InsnSequence extends InsnList {
index = Math.abs(index);
if(index > size())
throw new IndexOutOfBoundsException();
- return this.toArray()[size() - index];
+ return super.get(size() - index);
}
/**
@@ -72,7 +72,7 @@ public class InsnSequence extends InsnList {
/**
* Wraps InsnList's add() to throw an exception
- * when fed null values.
+ * when given null values.
* @param node to add
*/
@Override
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