Skip to content

Commit

Permalink
Fixed void method invokes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Jun 21, 2024
1 parent fa5f4aa commit cbc5ec7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ public static <R> Function<Object[], R> makeArrayInvoker(final Object instance,
mb.method(BUILDER.opcode("INVOKEVIRTUAL"), methodClass, method.getName(), methodDesc, false);
}
}
if (method.getReturnType() == void.class) mb.insn(BUILDER.opcode("ACONST_NULL"));
else mb.box(BUILDER, method.getReturnType());
mb
.box(BUILDER, method.getReturnType())
.insn(BUILDER.opcode("ARETURN"))
.maxs(method.getParameterCount() + 2, 2);
});
Expand Down Expand Up @@ -194,8 +195,9 @@ public static <I, R> BiFunction<I, Object[], R> makeDynamicArrayInvoker(@Nonnull
} else {
mb.method(BUILDER.opcode("INVOKEVIRTUAL"), slash(method.getDeclaringClass()), method.getName(), desc(method), false);
}
if (method.getReturnType() == void.class) mb.insn(BUILDER.opcode("ACONST_NULL"));
else mb.box(BUILDER, method.getReturnType());
mb
.box(BUILDER, method.getReturnType())
.insn(BUILDER.opcode("ARETURN"))
.maxs(method.getParameterCount() + 2, 3);
});
Expand Down

0 comments on commit cbc5ec7

Please sign in to comment.