Skip to content

Commit

Permalink
Fix: Properly extend the stack in ModifyArgInjector. (#144)
Browse files Browse the repository at this point in the history
The old logic doesn't really make any sense and the calculated extension usually ended up being negative.
Instead, we just make room for our possible receiver and all of our args.
  • Loading branch information
LlamaLad7 authored Jun 8, 2024
1 parent c093311 commit a8254c7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ protected void injectAtInvoke(Target target, InjectionNode node) {
}

target.insns.insertBefore(methodNode, insns);
target.extendStack().set(2 - (extraLocals.get() - 1)).apply();
Extension extraStack = target.extendStack();
if (!isStatic) {
extraStack.add();
}
extraStack.add(methodArgs);
extraStack.apply();
extraLocals.apply();
}

Expand Down

0 comments on commit a8254c7

Please sign in to comment.