Skip to content

Commit e86ac73

Browse files
committed
C#: Add attribute kind to the dbscheme for the attribute relation.
1 parent e6c9067 commit e86ac73

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

csharp/ql/lib/semmle/code/csharp/Attribute.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ class Attributable extends @attributable {
5050
*/
5151
class Attribute extends TopLevelExprParent, @attribute {
5252
/** Gets the type of this attribute. */
53-
Class getType() { attributes(this, getTypeRef(result), _) }
53+
Class getType() { attributes(this, _, getTypeRef(result), _) }
5454

5555
/** Gets the element that this attribute is attached to. */
56-
Attributable getTarget() { attributes(this, _, result) }
56+
Attributable getTarget() { attributes(this, _, _, result) }
5757

5858
/**
5959
* Gets the `i`th argument of this attribute. This includes both constructor

csharp/ql/lib/semmlecode.csharp.dbscheme

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,17 @@ tuple_element(
520520

521521
attributes(
522522
unique int id: @attribute,
523+
int kind: int ref,
523524
int type_id: @type_or_ref ref,
524525
int target: @attributable ref);
525526

527+
case @attribute.kind of
528+
0 = @attribute_default
529+
| 1 = @attribute_return
530+
| 2 = @attribute_assembly
531+
| 3 = @attribute_module
532+
;
533+
526534
attribute_location(
527535
int id: @attribute ref,
528536
int loc: @location ref);

0 commit comments

Comments
 (0)