PR Feedback.

上级 00752581
......@@ -1140,6 +1140,9 @@ internal bool HasIsByRefLikeAttribute(EntityHandle token)
IAttributeNamedArgumentDecoder attributeArgumentDecoder,
Func<string, TypedConstant, bool, (bool IsCallConvs, ImmutableHashSet<INamedTypeSymbolInternal>? CallConvs)> unmanagedCallersOnlyDecoder)
{
// We don't want to load all attributes and their public data just to answer whether a PEMethodSymbol has an UnmanagedCallersOnly
// attached. It would create unnecessary memory pressure that isn't going to be needed 99% of the time, so we just crack this 1
// attribute.
AttributeInfo info = FindTargetAttribute(token, AttributeDescription.UnmanagedCallersOnlyAttribute);
if (!info.HasValue || info.SignatureIndex != 0 || !TryGetAttributeReader(info.Handle, out BlobReader sigReader))
{
......
......@@ -23,7 +23,7 @@ internal static UnmanagedCallersOnlyAttributeData Create(ImmutableHashSet<INamed
=> callingConventionTypes switch
{
null or { IsEmpty: true } => PlatformDefault,
_ => new UnmanagedCallersOnlyAttributeData(callingConventionTypes ?? ImmutableHashSet<INamedTypeSymbolInternal>.Empty)
_ => new UnmanagedCallersOnlyAttributeData(callingConventionTypes)
};
public readonly ImmutableHashSet<INamedTypeSymbolInternal> CallingConventionTypes;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册