Add TryCatchBlockNode::remap for consistency

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 4 years ago
parent 8dd5292cb2
commit f291b121bc
  1. 7
      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")

Loading…
Cancel
Save