Fix dummy arg removal for virtual methods

Fixes an off-by-one error in the argument list.

Signed-off-by: Major <major@emulate.rs>
bzip2
Major 5 years ago
parent 51890c56b3
commit 7996d327ff
  1. 7
      deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt

@ -196,11 +196,12 @@ class DummyArgTransformer : Transformer() {
}
val invoke = match[match.size - 1] as MethodInsnNode
val invokeArgTypes = Type.getArgumentTypes(invoke.desc).size
val constArgs = arrayOfNulls<Int>(invokeArgTypes)
var invokeArgCount = Type.getArgumentTypes(invoke.desc).size
if (invoke.opcode != Opcodes.INVOKESTATIC) {
matchIndex++
invokeArgCount++
}
val constArgs = arrayOfNulls<Int>(invokeArgCount)
for (i in constArgs.indices) {
val insn = match[matchIndex++]
if (insn.opcode == Opcodes.ACONST_NULL) {

Loading…
Cancel
Save