Browse Source

Fix dummy arg removal for virtual methods

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

Signed-off-by: Major <major@emulate.rs>
pull/84/head
Major 2 years ago
parent
commit
7996d327ff
  1. 7
      deob/src/main/java/dev/openrs2/deob/transform/DummyArgTransformer.kt

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