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

Avoid compiler crash when UsageBasedMetadataGenerationOptions.CompleteTypesOnly is specified #106445

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

MichalStrehovsky
Copy link
Member

Fixes #106439.

This is an unsupported flag that allows generating unusable metadata for type members that would have been trimmed. This is useful when troubleshooting trimming issues for people who ignore trimming warnings because it converts random NullReferenceException (e.g. GetMethod returned null and the program didn't check for it) into "Foo.Bar wasn't generated" exceptions.

Because this isn't tested, we regressed this. The code that checks whether it's possible to generate the metadata for the member at all stopped working for uninstantiated generics. This check is needed to deal with invalid input IL.

Cc @dotnet/ilc-contrib

…teTypesOnly` is specified

Fixes dotnet#106439.

This is an unsupported flag that allows generating unusable metadata for type members that would have been trimmed. This is useful when troubleshooting trimming issues for people who ignore trimming warnings because it converts random `NullReferenceException` (e.g. `GetMethod` returned null and the program didn't check for it) into "Foo.Bar wasn't generated" exceptions.

Because this isn't tested, we regressed this. The code that checks whether it's possible to generate the metadata for the member at all stopped working for uninstantiated generics. This check is needed to deal with invalid input IL.
@MichalStrehovsky MichalStrehovsky merged commit 7f315b1 into dotnet:main Aug 15, 2024
88 checks passed
@MichalStrehovsky MichalStrehovsky deleted the fix106439 branch August 15, 2024 10:17
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants