From 514799920e94af946e3bbd9c55413a4062948e32 Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 11 Jan 2024 20:00:11 +0000 Subject: [PATCH] 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 --- .../deob/bytecode/transform/ExceptionTracingTransformer.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deob-bytecode/src/main/kotlin/org/openrs2/deob/bytecode/transform/ExceptionTracingTransformer.kt b/deob-bytecode/src/main/kotlin/org/openrs2/deob/bytecode/transform/ExceptionTracingTransformer.kt index 251d2f6b87..edf340fb5d 100644 --- a/deob-bytecode/src/main/kotlin/org/openrs2/deob/bytecode/transform/ExceptionTracingTransformer.kt +++ b/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) {