Open
Description
Description
Exporting a function using UnmanagedCallersOnly
and the Fastcall calling convention will work, but calling ((delegate* unmanaged[Fastcall]<int, int>)somePtr)(someArg)
will fail with
System.TypeLoadException
HResult=0x80131522
Message=Unsupported unmanaged calling convention.
Reproduction Steps
unsafe
{
int x = ((delegate* unmanaged[Fastcall]<int, int>)IntPtr.Zero)(0);
}
Expected behavior
The function pointer should be called.
Actual behavior
The call fails due to the Fastcall calling convention being unimplemented.
Regression?
Unlikely that this was implemented before and removed afterwards.
Known Workarounds
No response
Configuration
Windows x86
Technically I'm running from a CoreCLR embedded in an application, but it should not matter in this scenario.
Other information
runtime/src/coreclr/vm/dllimport.cpp
Line 4238 in f17c21c
Metadata
Metadata
Assignees
Type
Projects
Status
No status