Commit 88de6d815190ce2e2e9f35966f92d309f6dee864

Authored by Mumfrey
1 parent e108d4a5

fix for CallbackInjectionTransformer when injecting REDIRECT callbacks into non-…

…void-returning methods at the method head
java/common/com/mumfrey/liteloader/transformers/CallbackInjectionTransformer.java
@@ -294,7 +294,7 @@ public abstract class CallbackInjectionTransformer extends ClassTransformer @@ -294,7 +294,7 @@ public abstract class CallbackInjectionTransformer extends ClassTransformer
294 } 294 }
295 295
296 // Generate the callback method descriptor 296 // Generate the callback method descriptor
297 - String callbackMethodDesc = String.format("(%s%s%s%s)%s", callbackReturnValueArg, hasReturnRef ? "I" : "", classInstanceArg, CallbackInjectionTransformer.getMethodArgs(methodNode), callbackReturnType); 297 + String callbackMethodDesc = String.format("(%s%s%s%s)%s", hasReturnRef ? callbackReturnValueArg : "", hasReturnRef ? "I" : "", classInstanceArg, CallbackInjectionTransformer.getMethodArgs(methodNode), callbackReturnType);
298 298
299 // Add the callback method insn to the injected instructions list 299 // Add the callback method insn to the injected instructions list
300 injected.add(new MethodInsnNode(Opcodes.INVOKESTATIC, callback.getCallbackClass(), callback.getCallbackMethod(), callbackMethodDesc, false)); 300 injected.add(new MethodInsnNode(Opcodes.INVOKESTATIC, callback.getCallbackClass(), callback.getCallbackMethod(), callbackMethodDesc, false));