-
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
Activator.CreateInstance
supports ByRefLike types
#102636
Activator.CreateInstance
supports ByRefLike types
#102636
Conversation
This represents an update of Activator.CreateInstance to naturally support byreflike generics. It is modeled off of the current native AOT implementation.
Activator.CreateInstance
similar to NAOTActivator.CreateInstance
supports byreflike types
Activator.CreateInstance
supports byreflike typesActivator.CreateInstance
supports ByRefLike types
src/libraries/System.Private.CoreLib/src/System/Activator.RuntimeType.cs
Show resolved
Hide resolved
Wrap invocation in TargetInvocationException.
Mono crashes look related. I felt pretty certain just compiling the ctor would return something with the correct calling convention, but perhaps I need to verify that |
@AaronRobinsonMSFT please cherrypick lambdageek@c4067c4 The issue was that when using the interpreter there's a second crash in |
On the Mono interpreter, the ldftn opcode for a managed method returns a MonoFtnDesc*, not a native code pointer, and the calli opcode expects a MonoFtnDesc*. The MethodHandle.GetFunctionPointer() function is an interpreter intrinsic that returns such a MonoFtnDesc*
Thanks @lambdageek. I've applied the changes. Let's see if the CI is happy now. |
This represents an update of
Activator.CreateInstance
to naturally support byreflike generics.It is modeled off of the current native AOT implementation.
This now works for all runtimes - CoreCLR, mono and native AOT. Native AOT was a no-op as its implementation was ByRefLike ready.
Contributes to #65112