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

[release/6.0] [wasm] Fix typedef for non-void interp entry callbacks #59990

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 5, 2021

Backport of #59968 to release/6.0

/cc @lambdageek

Customer Impact

Interop with C code compiled for WebAssembly is new in .NET 6.
This PR fixes an issue with "reverse-P/Invokes" (managed methods that are passed as callbacks to C code) that have a non-void return type. The stubs generated for interop between native code and the interpreter were generated with the wrong type and failed during native compilation and linking. The stubs for callbacks with void return types are not affected.

Without this PR, one possible workaround is to compile the generated pinvoke header with fewer C compiler warnings turned on.

Testing

CI

Risk

Low. This is a new scenario - interop code on wasm is new code. A possible workaround is to write wrapper methods that pass an out-arg and have a void return type.

For UnmanagedCallersOnly methods that return non-void, pass the address of the
return variable to the interp entry method.
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@lambdageek
Copy link
Member

/cc @lewing

@lambdageek lambdageek added the arch-wasm WebAssembly architecture label Oct 5, 2021
@ghost
Copy link

ghost commented Oct 5, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #59968 to release/6.0

/cc @lambdageek

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

arch-wasm

Milestone: -

@lambdageek lambdageek added area-Interop-mono Servicing-consider Issue for next servicing release review labels Oct 5, 2021
@lambdageek lambdageek added this to the 6.0.0 milestone Oct 7, 2021
@lambdageek
Copy link
Member

Approved in email

@lambdageek lambdageek added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 15, 2021
@Anipik Anipik merged commit 92ff024 into release/6.0 Oct 18, 2021
@jkotas jkotas deleted the backport/pr-59968-to-release/6.0 branch October 23, 2021 13:06
@ghost ghost locked as resolved and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Interop-mono Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants