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

Support invoke of function pointer type arg #90270

Merged
merged 5 commits into from
Aug 14, 2023

Conversation

steveharter
Copy link
Member

@steveharter steveharter commented Aug 9, 2023

Addresses the main issue of #85028 which is the inability to invoke a method that has a function pointer type argument for CoreClr. Also adds support to Mono and fixes issue in NativeAot with returning function pointer types.

@ghost
Copy link

ghost commented Aug 9, 2023

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

[verifying tests]

Author: steveharter
Assignees: steveharter
Labels:

area-System.Reflection

Milestone: -

@steveharter steveharter force-pushed the FcnPtrFix branch 2 times, most recently from a41e446 to 86cb0eb Compare August 10, 2023 16:58
@steveharter steveharter marked this pull request as ready for review August 10, 2023 19:32
@ivanpovazan
Copy link
Member

Is this planned to be merged in by RC1 snap?
I am asking this because Mono support for function pointer introspection API is ready for review #89712 and I would like to synchronise and agree what should get merged in first to avoid any regressions.

@steveharter
Copy link
Member Author

Is this planned to be merged in by RC1 snap?

I'll hold off on this PR until the Mono function pointer introspection PR is in.

@ivanpovazan
Copy link
Member

I'll hold off on this PR until the #89712 is in.

Thank you. Done!

@vargaz
Copy link
Contributor

vargaz commented Aug 13, 2023

The mono changes look ok.

@jkotas
Copy link
Member

jkotas commented Aug 14, 2023

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. (Please check that the tests are passing on native AOT before merging - I have triggered extra-platforms run.)

This was referenced Aug 14, 2023
@@ -838,6 +838,11 @@ private unsafe object ReturnTransform(ref byte byref, bool wrapInTargetInvocatio
Debug.Assert(type.IsPointer);
obj = Pointer.Box((void*)Unsafe.As<byte, IntPtr>(ref byref), type);
}
else if ((_returnTransform & Transform.FunctionPointer) != 0)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, a checked build would throw in the else statement below where it tried to box _returnType.

@steveharter
Copy link
Member Author

LGTM. (Please check that the tests are passing on native AOT before merging - I have triggered extra-platforms run.)

Also verified locally with both release and checked runtime build.

Did update #90376 based on CI failures. Other failures appear unrelated.

@steveharter steveharter merged commit c6f64ab into dotnet:main Aug 14, 2023
240 of 256 checks passed
@steveharter steveharter deleted the FcnPtrFix branch August 14, 2023 15:24
@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants