Run ExceptionTracingTransformer until we reach a fixed point

The build 667 client has some ZKM exception handlers inside Jagex's
exeption tracing handlers. In a single pass, the regex is only capable
of matching the former and not the latter. The ZKM exception handlers
were removed, confusingly leaving Jagex exception handlers that do match
the CATCH_MATCHER regex.

Signed-off-by: Graham <gpe@openrs2.org>
master
Graham 4 months ago
parent 0cd8be87ca
commit 514799920e
  1. 6
      deob-bytecode/src/main/kotlin/org/openrs2/deob/bytecode/transform/ExceptionTracingTransformer.kt

@ -42,6 +42,8 @@ public class ExceptionTracingTransformer : Transformer() {
clazz: ClassNode,
method: MethodNode
): Boolean {
var changed = false
for (match in CATCH_MATCHER.match(method)) {
val foundTryCatch = method.tryCatchBlocks.removeIf { tryCatch ->
tryCatch.type == "java/lang/RuntimeException" && tryCatch.handler.nextReal === match[0]
@ -50,9 +52,11 @@ public class ExceptionTracingTransformer : Transformer() {
if (foundTryCatch) {
match.forEach(method.instructions::remove)
tracingTryCatches++
changed = true
}
}
return false
return changed
}
override fun postTransform(classPath: ClassPath) {

Loading…
Cancel
Save