From 3a55c9d48a2b045162730d584bd1c53004b9da81 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 5 May 2026 09:49:41 +0200 Subject: [PATCH] C#: Update condition for UnaryOperators to also handle user-defined instance increment and decrement operators. --- csharp/ql/lib/semmle/code/csharp/Callable.qll | 3 +++ 1 file changed, 3 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/Callable.qll b/csharp/ql/lib/semmle/code/csharp/Callable.qll index 9416a7d4d9c..198ad2af180 100644 --- a/csharp/ql/lib/semmle/code/csharp/Callable.qll +++ b/csharp/ql/lib/semmle/code/csharp/Callable.qll @@ -613,6 +613,9 @@ class UnaryOperator extends Operator { this.getNumberOfParameters() = 1 and not this instanceof ConversionOperator and not this instanceof CompoundAssignmentOperator + or + // Instance increment and decrement operators don't have a parameter (only a qualifier). + this.getNumberOfParameters() = 0 and not this.isStatic() } }