diff --git a/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt b/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt index b40eeadb..63a29208 100644 --- a/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt +++ b/asm/src/main/java/dev/openrs2/asm/ClassNodeRemapper.kt @@ -15,6 +15,7 @@ import org.objectweb.asm.tree.MethodInsnNode import org.objectweb.asm.tree.MethodNode import org.objectweb.asm.tree.MultiANewArrayInsnNode import org.objectweb.asm.tree.ParameterNode +import org.objectweb.asm.tree.TryCatchBlockNode import org.objectweb.asm.tree.TypeInsnNode fun ClassNode.remap(remapper: ExtendedRemapper) { @@ -80,7 +81,7 @@ fun MethodNode.remap(remapper: ExtendedRemapper, owner: String) { } for (tryCatch in tryCatchBlocks) { - tryCatch.type = remapper.mapType(tryCatch.type) + tryCatch.remap(remapper) } } } @@ -89,6 +90,10 @@ fun ParameterNode.remap(remapper: ExtendedRemapper, owner: String, methodName: S name = remapper.mapArgumentName(owner, methodName, desc, index, name) } +fun TryCatchBlockNode.remap(remapper: Remapper) { + type = remapper.mapType(type) +} + fun AbstractInsnNode.remap(remapper: ExtendedRemapper) { when (this) { is FrameNode -> throw UnsupportedOperationException("SKIP_FRAMES and COMPUTE_FRAMES must be used")