Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public override void VisitAttributeList(AttributeListSyntax node)
SyntaxKind.ModuleKeyword => Entities.AttributeKind.Module,
_ => throw new InternalError(node, "Unhandled global target")
};
foreach (var attribute in node.Attributes)
var attributes = node.Attributes;
for (var i = 0; i < attributes.Count; i++)
{
var attribute = attributes[i];
if (attributeLookup.Value(attribute) is AttributeData attributeData)
{
var ae = Entities.Attribute.Create(Cx, attributeData, outputAssembly, kind);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| standalone.cs:3:12:3:29 | [assembly: Attribute1(...)] |
| standalone.cs:9:2:9:11 | [Attribute1(...)] |
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import csharp

from Attribute a
where a.getType().getName() = "Attribute1Attribute"
select a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
semmle-extractor-options: --standalone
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

[assembly: global::Attribute1]

class Attribute1Attribute : Attribute
{
}

[Attribute1]
class A
{
}