Fix handling of opaque predicate embedded in flow obstructor initializer

bzip2
Graham 5 years ago
parent 323d23b6d4
commit c4e08242aa
  1. 9
      deob/src/main/java/dev/openrs2/deob/transform/OpaquePredicateTransformer.kt

@ -44,8 +44,13 @@ class OpaquePredicateTransformer : Transformer() {
val putstatic = match.last() as FieldInsnNode val putstatic = match.last() as FieldInsnNode
flowObstructors.add(MemberRef(putstatic)) flowObstructors.add(MemberRef(putstatic))
// remove initializer // remove initializer (except the opaque predicate at the start,
match.forEach(method.instructions::remove) // which we treat like any other)
for ((i, insn) in match.withIndex()) {
if (i >= 2) {
method.instructions.remove(insn)
}
}
// remove field // remove field
val owner = library[putstatic.owner]!! val owner = library[putstatic.owner]!!

Loading…
Cancel
Save