diff --git a/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt b/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt index dcc622665e..932204582d 100644 --- a/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt @@ -205,8 +205,8 @@ fun AbstractInsnNode.stackMetadata(): StackMetadata = when (this) { val argumentsAndReturnSizes = Type.getArgumentsAndReturnSizes(desc) val pushes = argumentsAndReturnSizes and 0x3 var pops = argumentsAndReturnSizes shr 2 - if (opcode != Opcodes.INVOKESTATIC) { - pops++ + if (opcode == Opcodes.INVOKESTATIC) { + pops-- } StackMetadata(pops, pushes) } diff --git a/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt index 528f11f0eb..1d88cb462b 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt @@ -179,7 +179,7 @@ class DummyArgTransformer : Transformer() { var callerSlots = Type.getArgumentsAndReturnSizes(method.desc) shr 2 if (method.access and Opcodes.ACC_STATIC != 0) { - callerSlots++ + callerSlots-- } if (load.`var` >= callerSlots) { continue