Skip to content

Commit

Permalink
Fix Crossgen2 of PlatformDefaultMemberFunction methods and calls. (#5…
Browse files Browse the repository at this point in the history
…0754)

* Fix Crossgen2 of PlatformDefaultMemberFunction methods and calls.

* Update CorInfoImpl.cs
  • Loading branch information
jkoritzinsky authored Apr 6, 2021
1 parent 29c911e commit 856c879
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ private CorInfoCallConvExtension GetUnmanagedCallingConventionFromAttribute(Cust
}
}

if (found && memberFunctionVariant)
if (memberFunctionVariant)
{
callConv = GetMemberFunctionCallingConventionVariant(callConv);
}
Expand All @@ -603,6 +603,8 @@ private CorInfoCallConvExtension GetUnmanagedCallingConventionFromAttribute(Cust
private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signature, out CorInfoCallConvExtension callConv, out bool suppressGCTransition)
{
suppressGCTransition = false;
// Default to managed since in the modopt case we need to differentiate explicitly using a calling convention that matches the default
// and not specifying a calling convention at all and using the implicit default case in P/Invoke stub inlining.
callConv = CorInfoCallConvExtension.Managed;
if (!signature.HasEmbeddedSignatureData || signature.GetEmbeddedSignatureData() == null)
return false;
Expand Down Expand Up @@ -649,9 +651,9 @@ private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signatur
}
}

if (found && memberFunctionVariant)
if (memberFunctionVariant)
{
callConv = GetMemberFunctionCallingConventionVariant(callConv);
callConv = GetMemberFunctionCallingConventionVariant(found ? callConv : (CorInfoCallConvExtension)PlatformDefaultUnmanagedCallingConvention());
}

return found;
Expand Down

0 comments on commit 856c879

Please sign in to comment.