From 81284c8401b657f5805b670f4628a734b4561807 Mon Sep 17 00:00:00 2001 From: LlamaLad7 Date: Sat, 13 Jul 2024 18:56:08 +0100 Subject: [PATCH] Fix: Remove incorrect `PUTFIELD` owner check when inspecting initialisers. These will never match because the LHS is the mixin name and the RHS is the target name. This restores the 0.8.5 behaviour which does not check the owner at all. We have never supported assignment expressions in initialisers until now anyway, and even if we check the owner we cannot determine whether the instruction is operating on the current *instance* without proper static analysis, so IMO there's not much point bothering. --- .../spongepowered/asm/mixin/injection/struct/Constructor.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/Constructor.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/Constructor.java index 943edadf2..615b6c28d 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/Constructor.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/Constructor.java @@ -113,10 +113,6 @@ public void inspect(Initialiser initialiser) { for (AbstractInsnNode initialiserInsn : initialiser.getInsns()) { if (initialiserInsn.getOpcode() == Opcodes.PUTFIELD) { - FieldInsnNode fieldInsn = (FieldInsnNode)initialiserInsn; - if (!fieldInsn.owner.equals(this.targetName)) { - continue; - } this.mixinInitialisedFields.add(Constructor.fieldKey((FieldInsnNode)initialiserInsn)); } }