Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
673 B
21 lines
673 B
package dev.openrs2.asm.classpath
|
|
|
|
import org.objectweb.asm.ClassWriter
|
|
|
|
class StackFrameClassWriter(private val classPath: ClassPath) : ClassWriter(COMPUTE_FRAMES) {
|
|
override fun getCommonSuperClass(type1: String, type2: String): String {
|
|
var c = classPath[type1]!!
|
|
val d = classPath[type2]!!
|
|
return when {
|
|
c.isAssignableFrom(d) -> type1
|
|
d.isAssignableFrom(c) -> type2
|
|
c.`interface` || d.`interface` -> "java/lang/Object"
|
|
else -> {
|
|
do {
|
|
c = c.superClass!!
|
|
} while (!c.isAssignableFrom(d))
|
|
c.name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|