Fix handling of opaque predicate embedded in flow obstructor initializer

pull/66/head
Graham 4 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
flowObstructors.add(MemberRef(putstatic))
// remove initializer
match.forEach(method.instructions::remove)
// remove initializer (except the opaque predicate at the start,
// which we treat like any other)
for ((i, insn) in match.withIndex()) {
if (i >= 2) {
method.instructions.remove(insn)
}
}
// remove field
val owner = library[putstatic.owner]!!

Loading…
Cancel
Save