From a0d6a48922f25fd8d7dd9ac59b3bc221205eb329 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Feb 2020 16:05:01 +0000 Subject: [PATCH] Fix StackMetadata for MethodInsnNodes --- asm/src/main/java/dev/openrs2/asm/StackMetadata.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt b/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt index 5a898bd1..6ba8d431 100644 --- a/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt +++ b/asm/src/main/java/dev/openrs2/asm/StackMetadata.kt @@ -203,8 +203,8 @@ fun AbstractInsnNode.stackMetadata(): StackMetadata = when (this) { } is MethodInsnNode -> { val argumentsAndReturnSizes = Type.getArgumentsAndReturnSizes(desc) - val pushes = argumentsAndReturnSizes shr 2 - var pops = argumentsAndReturnSizes and 0x3 + val pushes = argumentsAndReturnSizes and 0x3 + var pops = argumentsAndReturnSizes shr 2 if (opcode != Opcodes.INVOKESTATIC) { pops++ }