diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/JsrInliner.kt b/asm/src/main/java/dev/openrs2/asm/classpath/JsrInliner.kt new file mode 100644 index 00000000..630ad86c --- /dev/null +++ b/asm/src/main/java/dev/openrs2/asm/classpath/JsrInliner.kt @@ -0,0 +1,19 @@ +package dev.openrs2.asm.classpath + +import org.objectweb.asm.ClassVisitor +import org.objectweb.asm.MethodVisitor +import org.objectweb.asm.Opcodes +import org.objectweb.asm.commons.JSRInlinerAdapter + +class JsrInliner(cv: ClassVisitor) : ClassVisitor(Opcodes.ASM7, cv) { + override fun visitMethod( + access: Int, + name: String, + descriptor: String, + signature: String?, + exceptions: Array? + ): MethodVisitor { + val mv = super.visitMethod(access, name, descriptor, signature, exceptions) + return JSRInlinerAdapter(mv, access, name, descriptor, signature, exceptions) + } +} diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt index d5000b91..6d1fdff4 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/Library.kt @@ -159,7 +159,7 @@ class Library constructor() : Iterable { val clazz = ClassNode() val reader = ClassReader(`in`) - reader.accept(clazz, ClassReader.SKIP_DEBUG) + reader.accept(JsrInliner(clazz), ClassReader.SKIP_DEBUG) library.add(clazz) }