Skip to content

Commit af37d5a

Browse files
committed
C#: Update condition for UnaryOperators to also handle user-defined instance increment and decrement operators.
1 parent 06e61e6 commit af37d5a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ class UnaryOperator extends Operator {
613613
this.getNumberOfParameters() = 1 and
614614
not this instanceof ConversionOperator and
615615
not this instanceof CompoundAssignmentOperator
616+
or
617+
// Instance increment and decrement operators don't have a parameter (only a qualifier).
618+
this.getNumberOfParameters() = 0 and not this.isStatic()
616619
}
617620
}
618621

0 commit comments

Comments
 (0)