Skip to content

Commit 3073810

Browse files
committed
C#: Add unsigned right shift operator class.
1 parent 148dc6d commit 3073810

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,8 @@ class TrueOperator extends UnaryOperator {
637637
* operator (`DivOperator`), a remainder operator (`RemOperator`), an and
638638
* operator (`AndOperator`), an or operator (`OrOperator`), an xor
639639
* operator (`XorOperator`), a left shift operator (`LeftShiftOperator`),
640-
* a right shift operator (`RightShiftOperator`), an equals operator (`EQOperator`),
640+
* a right shift operator (`RightShiftOperator`), an unsigned right shift
641+
* operator(`UnsignedRightShiftOperator`), an equals operator (`EQOperator`),
641642
* a not equals operator (`NEOperator`), a lesser than operator (`LTOperator`),
642643
* a greater than operator (`GTOperator`), a less than or equals operator
643644
* (`LEOperator`), or a greater than or equals operator (`GEOperator`).
@@ -822,6 +823,23 @@ class RightShiftOperator extends BinaryOperator {
822823
/** DEPRECATED: Alias for RightShiftOperator. */
823824
deprecated class RShiftOperator = RightShiftOperator;
824825

826+
/**
827+
* A user-defined unsigned right shift operator (`>>>`), for example
828+
*
829+
* ```csharp
830+
* public static Widget operator >>>(Widget lhs, Widget rhs) {
831+
* ...
832+
* }
833+
* ```
834+
*/
835+
class UnsignedRightShiftOperator extends BinaryOperator {
836+
UnsignedRightShiftOperator() { this.getName() = ">>>" }
837+
838+
override string getFunctionName() { result = "op_UnsignedRightShift" }
839+
840+
override string getAPrimaryQlClass() { result = "UnsignedRightShiftOperator" }
841+
}
842+
825843
/**
826844
* A user-defined equals operator (`==`), for example
827845
*

0 commit comments

Comments
 (0)