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

[wasm] Fix typedef for non-void interp entry callbacks #59968

Merged

Conversation

lambdageek
Copy link
Member

For UnmanagedCallersOnly methods that return non-void, pass the address of the
return variable to the interp entry method.

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

ghost commented Oct 4, 2021

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

Issue Details

For UnmanagedCallersOnly methods that return non-void, pass the address of the
return variable to the interp entry method.

Author: lambdageek
Assignees: -
Labels:

arch-wasm, area-Interop-mono

Milestone: -

@lambdageek
Copy link
Member Author

Should we backport to 6.0? @lewing

@lambdageek
Copy link
Member Author

lambdageek commented Oct 4, 2021

Previously it was generating something like this:

typedef void  (*WasmInterpEntrySig_0) (int,int*,int*,int*,int*,int*,int*,int*);
int wasm_native_to_interp_System_Private_CoreLib_ComponentActivator_LoadAssemblyAndGetFunctionPointer (int arg0,int arg1,int arg2,int arg3,int arg4,int arg5) { 
int res;
((WasmInterpEntrySig_0)wasm_native_to_interp_ftndescs [0].func) (&res, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, wasm_native_to_interp_ftndescs [0].arg);
return res;
}

for

[UnmanagedCallersOnly]
public static unsafe int LoadAssemblyAndGetFunctionPointer(IntPtr assemblyPathNative, IntPtr typeNameNative, IntPtr methodNameNative, IntPtr delegateTypeNative, IntPtr reserved, IntPtr functionHandle)

@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2021

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1308006447

@lambdageek lambdageek merged commit f20ac34 into dotnet:main Oct 5, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants