Fix StackMetadata for MethodInsnNodes

master
Graham 5 years ago
parent 64a9ae33cb
commit a0d6a48922
  1. 4
      asm/src/main/java/dev/openrs2/asm/StackMetadata.kt

@ -203,8 +203,8 @@ fun AbstractInsnNode.stackMetadata(): StackMetadata = when (this) {
} }
is MethodInsnNode -> { is MethodInsnNode -> {
val argumentsAndReturnSizes = Type.getArgumentsAndReturnSizes(desc) val argumentsAndReturnSizes = Type.getArgumentsAndReturnSizes(desc)
val pushes = argumentsAndReturnSizes shr 2 val pushes = argumentsAndReturnSizes and 0x3
var pops = argumentsAndReturnSizes and 0x3 var pops = argumentsAndReturnSizes shr 2
if (opcode != Opcodes.INVOKESTATIC) { if (opcode != Opcodes.INVOKESTATIC) {
pops++ pops++
} }

Loading…
Cancel
Save