Skip to content

Commit

Permalink
Fix: Properly extend the stack in CallbackInjector.
Browse files Browse the repository at this point in the history
The old logic misses the receiver and does not correctly handle double-size types.
  • Loading branch information
LlamaLad7 committed Mar 4, 2024
1 parent 9213536 commit 86fa626
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ private class Callback extends InsnList {
this.invoke = target.extendStack();
this.ctor = target.extendStack();

this.invoke.add(target.arguments.length);
if (this.canCaptureLocals) {
this.invoke.add(this.localTypes.length - this.frameSize);
}
this.invoke.add().add(handlerArgs);

//If the handler doesn't captureArgs, the CallbackInfo(Returnable) will be the first LVT slot, otherwise it will be at the target's frameSize
int callbackInfoSlot = handlerArgs.length == 1 ? Bytecode.isStatic(handler) ? 0 : 1 : frameSize;
Expand Down

0 comments on commit 86fa626

Please sign in to comment.