diff options
Diffstat (limited to 'src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs')
-rw-r--r-- | src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs b/src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs index 28ae8b621..2a39b7779 100644 --- a/src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs +++ b/src/Common/src/TypeSystem/IL/Stubs/CalliIntrinsic.cs @@ -18,7 +18,7 @@ namespace Internal.IL.Stubs { public static MethodIL EmitIL(MethodDesc target) { - Debug.Assert(target.Name == "Call"); + Debug.Assert(target.Name == "Call" || target.Name.StartsWith("StdCall")); Debug.Assert(target.Signature.Length > 0 && target.Signature[0] == target.Context.GetWellKnownType(WellKnownType.IntPtr)); @@ -44,7 +44,11 @@ namespace Internal.IL.Stubs parameters[i - 1] = template[i]; } - var signature = new MethodSignature(template.Flags, 0, returnType, parameters); + MethodSignatureFlags flags = template.Flags; + if (target.Name == "StdCall") + flags |= MethodSignatureFlags.UnmanagedCallingConventionStdCall; + + var signature = new MethodSignature(flags, 0, returnType, parameters); codeStream.Emit(ILOpcode.calli, emitter.NewToken(signature)); codeStream.Emit(ILOpcode.ret); |