Skip to content

Commit

Permalink
Revert "Fix: Check the staticness of the original call not the curren…
Browse files Browse the repository at this point in the history
…t one. (#132)"

This reverts commit 8c8ece2.
  • Loading branch information
LlamaLad7 committed Jul 9, 2024
1 parent 60aa12f commit b20b9b3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ public static Type[] getOriginalArgs(InjectionNode node) {
}

public static Type[] getCurrentArgs(InjectionNode node) {
MethodInsnNode original = (MethodInsnNode) node.getOriginalTarget();
MethodInsnNode current = (MethodInsnNode) node.getCurrentTarget();
Type[] currentArgs = Type.getArgumentTypes(current.desc);
if (node.isReplaced() && node.hasDecoration(RedirectInjector.Meta.KEY) && original.getOpcode() != Opcodes.INVOKESTATIC) {
// A redirect on a non-static target method will have an extra arg at the start that we don't care about.
MethodInsnNode methodNode = (MethodInsnNode) node.getCurrentTarget();
Type[] currentArgs = Type.getArgumentTypes(methodNode.desc);
if (node.isReplaced() && node.hasDecoration(RedirectInjector.Meta.KEY) && methodNode.getOpcode() != Opcodes.INVOKESTATIC) {
// A non-static redirect handler method will have an extra arg at the start that we don't care about.
return Arrays.copyOfRange(currentArgs, 1, currentArgs.length);
}
return currentArgs;
Expand Down

0 comments on commit b20b9b3

Please sign in to comment.