Skip to content

Commit

Permalink
Fix merged pending members pointing to an outdated owner instance
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Aug 13, 2024
1 parent 018350f commit 1e48d19
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/net/fabricmc/mappingio/tree/MemoryMappingTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ private void addPendingMember(MemberEntry<?> member) {
return;
}

ClassEntry owner = member.getOwner();
// Make sure the owner reference is pointing to an in-tree entry
ClassEntry owner = classesBySrcName.get(member.getOwner().getSrcName());
member.setOwner(owner);
boolean isField = member.getKind() == MappedElementKind.FIELD;
// tree-side src
String srcName = member.getSrcName();
Expand Down Expand Up @@ -1278,6 +1280,11 @@ public final ClassEntry getOwner() {
return owner;
}

void setOwner(ClassEntry owner) {
assert this.owner.getSrcName().equals(owner.getSrcName());
this.owner = owner;
}

@Override
void setSrcName(String name) {
super.setSrcName(name);
Expand Down Expand Up @@ -1316,7 +1323,7 @@ protected final boolean acceptMember(MappingVisitor visitor, boolean supplyDstDe
return acceptElement(visitor, dstDescs);
}

protected final ClassEntry owner;
protected ClassEntry owner;
protected String srcDesc;
private MemberKey key;
}
Expand Down

0 comments on commit 1e48d19

Please sign in to comment.