mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
C#: Also check the namespace of the InlineArrayAttribute.
This commit is contained in:
@@ -527,7 +527,11 @@ namespace Semmle.Extraction.CSharp
|
||||
public static bool IsInlineArray(this ITypeSymbol type)
|
||||
{
|
||||
var attributes = type.GetAttributes();
|
||||
var isInline = attributes.Any(attribute => attribute.AttributeClass?.Name == "InlineArrayAttribute");
|
||||
var isInline = attributes.Any(attribute =>
|
||||
attribute.AttributeClass is INamedTypeSymbol nt &&
|
||||
nt.Name == "InlineArrayAttribute" &&
|
||||
nt.ContainingNamespace.ToString() == "System.Runtime.CompilerServices"
|
||||
);
|
||||
return isInline;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user