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

Fix/supertype calculations #142

Merged
merged 2 commits into from
Jun 2, 2024

Conversation

LlamaLad7
Copy link
Collaborator

@LlamaLad7 LlamaLad7 commented Jun 2, 2024

The first commit is just a tiny bug in Mixin's local calculations that causes a hard crash if triggered.
The second commit is more interesting:
I forced Mixin's LVT generation on every method in every mixin target class on AOF7 and it failed on about 12 occasions with various exceptions, including 1 NPE that occurs naturally in the pack, and 4 attempts to live-load minecraft classes (!), albeit only on AppClassLoader so it didn't work anyway. The issues are largely related to attempts to look up ClassInfos for array types, which do not exist.
My overhaul includes:

  • An isSubTypeOf implementation largely taken from upstream ASM which has recently had many fixes to SimpleVerifier
  • An isInterface implementation that no longer throws on array types
  • isAssignableFrom and merge implementations based on a bespoke getCommonSupertype from MixinExtras' Expressions (the base implementation offloads most of this work to reflection which we cannot do)
  • An explicit getClass override to guard against accidental live-loading
  • I also removed the special-casing for the current class since it offers no real performance benefit and complicates things.

After these changes there are no errors at all.

@LlamaLad7 LlamaLad7 marked this pull request as draft June 2, 2024 12:55
@LlamaLad7
Copy link
Collaborator Author

I have since tested LVT generation on every loaded class in AOF7. The original implementation produces many hundreds of errors but my one still has a handful so I will investigate those.

@LlamaLad7
Copy link
Collaborator Author

Okay, all remaining errors are just the LVT generation correctly failing when it encounters a class that doesn't exist.

@LlamaLad7 LlamaLad7 marked this pull request as ready for review June 2, 2024 13:29
It previously didn't handle array types correctly among some other issues.
@LlamaLad7
Copy link
Collaborator Author

Minor fix to my assumption that arrays could not implement interfaces.

@modmuss50 modmuss50 merged commit c093311 into FabricMC:main Jun 2, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants