Fix: Add a LVT entry for the marshal var in CallbackInjector if necessary.

If the callbackInfo has one already then that's fine since nothing can inject before the duped return value gets replaced by the callbackInfo.
This commit is contained in:
LlamaLad7 authored and modmuss50 committed 2023-05-04 09:16:43 +01:00
1 parent 1cf8a409f4
commit cac3570399
1 file changed
+2
@@ -750,6 +750,8 @@ public class CallbackInjector extends Injector {
if (store) {
callback.target.addLocalVariable(this.callbackInfoVar, "callbackInfo" + this.callbackInfoVar, "L" + this.callbackInfoClass + ";");
callback.add(new VarInsnNode(Opcodes.ASTORE, this.callbackInfoVar), false, false, head);
} else if (callback.isAtReturn) {
callback.target.addLocalVariable(this.callbackInfoVar, "returnValue" + this.callbackInfoVar, callback.target.returnType.getDescriptor());
}
}