Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/scala/li/cil/oc/common/asm/ASMHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static void dumpClass(String className, byte[] originalBytes, byte[] tran
}
}

public static MethodNode copyMethodNode(MethodNode methodNode) {
public static synchronized MethodNode copyMethodNode(MethodNode methodNode) {

@Nikolay-Sitnikov Nikolay-Sitnikov Oct 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? This doesn't access any state shared between threads. (unless you mean the MethodNode, in which case I think it's still safe, since this method doesn't mutate the shared MethodNode), which makes it safe to use between threads (as long as no other threads access the MethodNode before the MethodNode is finalized.)

MethodNode newMethodNode = new MethodNode(
methodNode.access, methodNode.name, methodNode.desc, methodNode.signature,
methodNode.exceptions == null ? null : methodNode.exceptions.toArray(new String[0])
Expand Down