Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There can only be one definition for each target method #19

Open
Juuxel opened this issue Nov 9, 2021 · 2 comments
Open

There can only be one definition for each target method #19

Juuxel opened this issue Nov 9, 2021 · 2 comments

Comments

@Juuxel
Copy link
Member

Juuxel commented Nov 9, 2021

If the target method is defined multiple times, only the latest definition is taken into account and previous unpick data will be lost.

This is a slight problem in Yarn where we want to split Unpick files mostly by constant groups, and the same method might have multiple constant groups, so we have to put all categories into a longer file.

I think this is the cause (not 100% sure, just found this when digging around on GH):

parent.targetMethods.put(name + descriptor, new TargetMethod(owner, name, descriptor, parameterConstantGroups, returnConstantGroup));

The put call just ignores existing data.

@Daomephsta
Copy link
Collaborator

Just need to make it merge constant groups then

Daomephsta added a commit to Daomephsta/unpick that referenced this issue Nov 22, 2021
@apple502j
Copy link

Another related issue: unpick currently doesn't handle different methods with the same name and descriptor at all.

FabricMC/yarn#3114 unpicks three constructors of inner enums in GlStateManager: SrcFactor, DstFactor, and LogicOp - they all have the same descriptor <init>(Ljava/lang/String;II)V, so the last unpick definition overwrites the definition for the previous two.

Unlike the cases mentioned before, though, merging makes no sense here, as they are all separate methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants