Skip to content

Commit

Permalink
Fix: Remove incorrect PUTFIELD owner check when inspecting initiali…
Browse files Browse the repository at this point in the history
…sers.

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.
  • Loading branch information
LlamaLad7 committed Jul 19, 2024
1 parent 74a1696 commit 81284c8
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 81284c8

Please sign in to comment.