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
2 changes: 2 additions & 0 deletions csharp/ql/lib/semmle/code/csharp/Assignable.qll
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Assignable extends Declaration, @assignable {
final AnnotatedType getAnnotatedType() { result.appliesTo(this) }

/** Gets an access to this assignable. */
pragma[nomagic]
AssignableAccess getAnAccess() { result.getTarget() = this }

/** Gets an expression assigned to this assignable, if any. */
Expand All @@ -31,6 +32,7 @@ class Assignable extends Declaration, @assignable {
* property (`Property`), an indexer (`Indexer`), or an event (`Event`).
*/
class AssignableMember extends Member, Assignable, Attributable {
pragma[nomagic]
override AssignableMemberAccess getAnAccess() { result = Assignable.super.getAnAccess() }

override string toString() { result = Assignable.super.toString() }
Expand Down
1 change: 1 addition & 0 deletions csharp/ql/lib/semmle/code/csharp/Member.qll
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ class Modifiable extends Declaration, @modifiable {
/** A declaration that is a member of a type. */
class Member extends Modifiable, @member {
/** Gets an access to this member. */
pragma[nomagic]
MemberAccess getAnAccess() { result.getTarget() = this }

/**
Expand Down
2 changes: 2 additions & 0 deletions csharp/ql/lib/semmle/code/csharp/Property.qll
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ class Property extends DeclarationWithGetSetAccessors, @property {
result = DeclarationWithGetSetAccessors.super.getAnUltimateImplementor()
}

pragma[nomagic]
override PropertyAccess getAnAccess() { result.getTarget() = this }

override Location getALocation() { property_location(this.getUnboundDeclaration(), result) }
Expand Down Expand Up @@ -326,6 +327,7 @@ class Indexer extends DeclarationWithGetSetAccessors, Parameterizable, @indexer
indexers(this, _, _, getTypeRef(result), _)
}

pragma[nomagic]
override IndexerAccess getAnAccess() { result.getTarget() = this }

/**
Expand Down
2 changes: 2 additions & 0 deletions csharp/ql/lib/semmle/code/csharp/Variable.qll
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ private import TypeRef
class Variable extends Assignable, @variable {
override Variable getUnboundDeclaration() { result = this }

pragma[nomagic]
override VariableAccess getAnAccess() { result.getTarget() = this }

/** Gets the type of this variable. */
Expand Down Expand Up @@ -438,6 +439,7 @@ class Field extends Variable, AssignableMember, Attributable, TopLevelExprParent

override Field getUnboundDeclaration() { fields(this, _, _, _, _, result) }

pragma[nomagic]
override FieldAccess getAnAccess() { result = Variable.super.getAnAccess() }

override ValueOrRefType getDeclaringType() { fields(this, _, _, result, _, _) }
Expand Down
Loading