diff --git a/csharp/ql/lib/semmle/code/csharp/exprs/BitwiseOperation.qll b/csharp/ql/lib/semmle/code/csharp/exprs/BitwiseOperation.qll index ae5e8fc6e6e..b6449f71a48 100644 --- a/csharp/ql/lib/semmle/code/csharp/exprs/BitwiseOperation.qll +++ b/csharp/ql/lib/semmle/code/csharp/exprs/BitwiseOperation.qll @@ -35,6 +35,36 @@ class BinaryBitwiseOperation extends BitwiseOperation, BinaryOperation, @bin_bit override string getOperator() { none() } } +/** + * A bitwise-and operation, either `x & y` or `x &= y`. + */ +class BitwiseAndOperation extends BinaryBitwiseOperation, @and_operation { } + +/** + * A bitwise-or operation, either `x | y` or `x |= y`. + */ +class BitwiseOrOperation extends BinaryBitwiseOperation, @or_operation { } + +/** + * A bitwise exclusive-or operation, either `x ^ y` or `x ^= y`. + */ +class BitwiseXorOperation extends BinaryBitwiseOperation, @xor_operation { } + +/** + * A left-shift operation, either `x << y` or `x <<= y`. + */ +class LeftShiftOperation extends BinaryBitwiseOperation, @lshift_operation { } + +/** + * A right-shift operation, either `x >> y` or `x >>= y`. + */ +class RightShiftOperation extends BinaryBitwiseOperation, @rshift_operation { } + +/** + * An unsigned right-shift operation, either `x >>> y` or `x >>>= y`. + */ +class UnsignedRightShiftOperation extends BinaryBitwiseOperation, @urshift_operation { } + /** * A binary bitwise expression. Either a bitwise-and expression * (`BitwiseAndExpr`), a bitwise-or expression (`BitwiseOrExpr`), diff --git a/csharp/ql/lib/semmle/code/csharp/exprs/Operation.qll b/csharp/ql/lib/semmle/code/csharp/exprs/Operation.qll index d920f169a6d..eb1a2bea9a5 100644 --- a/csharp/ql/lib/semmle/code/csharp/exprs/Operation.qll +++ b/csharp/ql/lib/semmle/code/csharp/exprs/Operation.qll @@ -4,36 +4,6 @@ import Expr -/** - * A bitwise-and operation, either `x & y` or `x &= y`. - */ -class BitwiseAndOperation extends BinaryBitwiseOperation, @and_operation { } - -/** - * A bitwise-or operation, either `x | y` or `x |= y`. - */ -class BitwiseOrOperation extends BinaryBitwiseOperation, @or_operation { } - -/** - * A bitwise exclusive-or operation, either `x ^ y` or `x ^= y`. - */ -class BitwiseXorOperation extends BinaryBitwiseOperation, @xor_operation { } - -/** - * A left-shift operation, either `x << y` or `x <<= y`. - */ -class LeftShiftOperation extends BinaryBitwiseOperation, @lshift_operation { } - -/** - * A right-shift operation, either `x >> y` or `x >>= y`. - */ -class RightShiftOperation extends BinaryBitwiseOperation, @rshift_operation { } - -/** - * An unsigned right-shift operation, either `x >>> y` or `x >>>= y`. - */ -class UnsignedRightShiftOperation extends BinaryBitwiseOperation, @urshift_operation { } - /** * A null-coalescing operation, either `x ?? y` or `x ??= y`. */