-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
UnmanagedCallersOnlyAttribute returning non-primitive value types do not work #35928
Labels
Milestone
Comments
I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label. |
/cc @vargaz |
jkoritzinsky
added a commit
that referenced
this issue
Dec 15, 2020
* Allow non-primitive struct returns to not require a stub. Fixes #35928. * Support propagating the UnmanagedCallersOnly calling convention to the JIT. Block UnmanagedCallersOnly in crossgen1 since the attribute parsing code isn't included. * Support passing through the calling convention for UnmanagedCallersOnly in crossgen2 * Fix clang errors. * Fix stack calculation. * Fix usings * Clean up jitinterface. * Remove invalid assert. * Fix up stdcall name mangling lookup. * Fix flag condition. * Use the register var type when copying from the register to the stack. * Change flag check for readability. * Rename variables to remove shadowing. * Fix formatting. * Create new getEntryPointCallConv method on the EE-JIT interface to handle all calling convention resolution and support extensible calling conventions. * Remove unreachable code. * Remove now unused getUnmanagedCallConv jitinterface method (replaced by getEntryPointCallConv). * Fix formatting. * Rename getEntryPointCallConv and only call it with a method when it's a P/Invoke or Reverse P/Invoke. * Pass SuppressGCTransition through the getUnmanagedCallConv JIT-EE interface API. * Refactor callconv handling so we can handle reverse P/Invokes with the callconv in the signature (and not in an UnmanagedCallersOnly attribute). * Clean up whitespace. * Pass MethodIL as the scope for the signature to enable propagating down annotations for calli's in P/Invokes. * Remove usages of CORINFO_CALLCONV_FOO where FOO is an unmanaged callconv. move the definitions of those ones to the interpreter since that's the only place they're used. * SuppressGC cleanup. * Rename superpmi struct * Add default condition to make clang happy. * change enums to make clang happy. * Remove CORINFO_CALLCONV_C and family from interpreter. * Fix up handling of managed function pointers and remove invalid assert. * Continue to use sigflag for suppressgc workaround. * Clean up comment wording. Signed-off-by: Jeremy Koritzinsky <[email protected]> * Remove more MethodIL passing we don't need any more * Update src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs Co-authored-by: Jan Kotas <[email protected]> * Fix SigTypeContext creation. * Pass context by ptr. * Fix formatting. * Clear the Reverse P/Invoke flag when compiling inlinees. It's only needed on the entry-point functions. Co-authored-by: Jan Kotas <[email protected]>
How is this going to work without marshal attributes ? |
The returned value type must be a blittable value type. As a result, it doesn’t require marshalling and the marshal attributes aren’t needed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected: works fine
Actual: fails
More context: #35926 (comment)
The text was updated successfully, but these errors were encountered: