From 7811bc70f41531c7152a6d048463a72cf16ce836 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 20 Jun 2020 10:36:57 +0100 Subject: [PATCH] Use IdentityHashMap to store original instruction indexes I think it is better to be explicit here, instead of relying on ASM's current lack of equals()/hashCode() methods in the AbstractInsnNode class. Signed-off-by: Graham --- asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt b/asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt index 3df2c52679..30ce329ca3 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/ClassPath.kt @@ -8,6 +8,7 @@ import dev.openrs2.util.collect.ForestDisjointSet import org.objectweb.asm.Opcodes import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.ClassNode +import java.util.IdentityHashMap class ClassPath( private val runtime: ClassLoader, @@ -25,7 +26,7 @@ class ClassPath( * Transformers to avoid adding extraneous labels until the last possible * moment, which would confuse some of our analyses if added earlier. */ - val originalPcs = mutableMapOf() + val originalPcs = IdentityHashMap() val libraryClasses: Sequence get() = libraries.asSequence().flatten().map { get(it.name)!! }