-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/8.0] [mono] Handle enum return type when inlining CreateInstance #91061
Conversation
Use underlying base type when deciding how to inline a CreateInstance invocation in mini_emit_inst_for_method. Fixes #90292 (Mono abort causing .NET 8 msbuild regression).
@SamMonoRT @marek-safar can we get your blessing for this change? |
We are waiting for @lambdageek to review when he's back next Monday. |
Adding blocked label - we need a further approval. |
@marek-safar @jeffschwMSFT - needs an approval for backport. It is validated. |
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.
approved. this can be merged when ready
/cc @carlossanlop - this is ready to be merged. Thank you. |
Backport of #91008 to release/8.0
/cc @fanyang-mono @uweigand
Customer Impact
Mono has the logic to inline the call to System.Activator.CreateInstance(). Prior to this change, Mono always assumed
T
as non-primitive type. However, for the customer reported situation,T
was a enum type. Treating it as non-primitive type led to incorrect generated code. That triggered an assertion during runtime.Testing
The customer confirmed that with this change, the assertion went away and the generated code was correct. All CI lanes were passed as well.
Risk
Adding a new scenario that Mono wasn't considering before. Thus, the risk of breaking existing functionality is very low.