Skip to content

Commit 06de084

Browse files
committed
feat: implemented typeproxy in amultiarray mtaching
1 parent 91a27bc commit 06de084

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected MethodProxy(String name, int modifiers, QualifiableProxy parent, Type[
5151
* @param m the {@link Method} object corresponding to this.
5252
*/
5353
public MethodProxy(Method m) {
54-
this(m.getName(),
54+
this(
55+
m.getName(),
5556
m.getModifiers(),
5657
TypeProxy.from(m.getDeclaringClass()),
5758
Type.getArgumentTypes(m),
@@ -195,7 +196,8 @@ public MethodProxy build() {
195196
this.modifiers,
196197
this.parent,
197198
this.parameters.toArray(new Type[0]),
198-
this.returnType);
199+
this.returnType
200+
);
199201
}
200202
}
201203
}

src/main/java/ftbsc/lll/utils/PatternMatcher.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,14 @@ && matchList(1, args, lookup.keys.toArray(), false, Object::equals)
337337
&& matchList(2, args, lookup.labels.toArray(), false, Object::equals);
338338
case AbstractInsnNode.MULTIANEWARRAY_INSN:
339339
MultiANewArrayInsnNode mana = (MultiANewArrayInsnNode) i;
340-
return args.length == 2 // TODO add proxy support
341-
&& mana.desc.equals(args[0])
340+
return args.length == 2
342341
&& args[1] instanceof Integer
343-
&& mana.dims == (Integer) args[1];
342+
&& mana.dims == (Integer) args[1]
343+
&& mana.desc.equals(
344+
args[0] instanceof TypeProxy
345+
? ((TypeProxy) args[0]).descriptor
346+
: args[0]
347+
);
344348
case AbstractInsnNode.METHOD_INSN:
345349
MethodInsnNode method = (MethodInsnNode) i;
346350
boolean methodMatch = true;

0 commit comments

Comments
 (0)