-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix HFA treatment of floating-point-based enums. #115591
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
Conversation
…n IL) as an HFA in crossgen2 like we do for CoreCLR.
|
/azp run runtime-coreclr crossgen2 outerloop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes the handling of floating-point-based enums for HFA computation, aligning the behavior with CoreCLR.
- Adjusts the enum type handling to use the underlying type instead of the enum type itself.
- Adds a clarifying comment explaining the rationale behind the change.
Comments suppressed due to low confidence (2)
src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs:1084
- Add unit tests to validate that floating-point-based enums are correctly treated as HFAs.
MetadataType metadataType = (MetadataType)type.UnderlyingType;
src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs:1084
- Consider verifying or asserting that 'type' is indeed an enum before accessing its 'UnderlyingType' to ensure that the cast is always safe.
MetadataType metadataType = (MetadataType)type.UnderlyingType;
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Crossgen-comparison failure is an infra issue in main. Merging this in. |
|
/ba-g iOS failure is unrelated |
Treat enums of floating point types (something that's only possible in IL) as an HFA in crossgen2 like we do for CoreCLR.
Fixes failure in https://dev.azure.com/dnceng-public/public/_build/results?buildId=1041124&view=results.
Fixes #104927