Skip to content

Commit 11cb22e

Browse files
committed
C#: Update the QL library to reflect the changes to the DB scheme.
1 parent f405ac0 commit 11cb22e

5 files changed

Lines changed: 16 additions & 6 deletions

File tree

csharp/ql/lib/semmle/code/csharp/exprs/ArithmeticOperation.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class ArithmeticOperation extends Operation, @arith_op_expr {
2020
* (`UnaryMinusExpr`), a unary plus operation (`UnaryPlusExpr`),
2121
* or a mutator operation (`MutatorOperation`).
2222
*/
23-
class UnaryArithmeticOperation extends ArithmeticOperation, UnaryOperation, @un_arith_op_expr { }
23+
class UnaryArithmeticOperation extends ArithmeticOperation, UnaryCallOperation, @un_arith_op_expr {
24+
}
2425

2526
/**
2627
* A unary minus operation, for example `-x`.
@@ -44,7 +45,7 @@ class UnaryPlusExpr extends UnaryArithmeticOperation, @plus_expr {
4445
* A mutator operation. Either an increment operation (`IncrementOperation`)
4546
* or a decrement operation (`DecrementOperation`).
4647
*/
47-
class MutatorOperation extends UnaryArithmeticOperation, @mut_op_expr { }
48+
class MutatorOperation extends UnaryArithmeticOperation, QualifiableExpr, @mut_op_expr { }
4849

4950
/**
5051
* An increment operation. Either a postfix increment operation

csharp/ql/lib/semmle/code/csharp/exprs/BitwiseOperation.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BitwiseOperation extends Operation, @bit_expr { }
1616
* A unary bitwise operation, that is, a bitwise complement operation
1717
* (`ComplementExpr`).
1818
*/
19-
class UnaryBitwiseOperation extends BitwiseOperation, UnaryOperation, @un_bit_op_expr { }
19+
class UnaryBitwiseOperation extends BitwiseOperation, UnaryCallOperation, @un_bit_op_expr { }
2020

2121
/**
2222
* A bitwise complement operation, for example `~x`.

csharp/ql/lib/semmle/code/csharp/exprs/Call.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ class ExtensionOperatorCall extends OperatorCall {
545545
}
546546

547547
/**
548-
* A call to a user-defined mutator operator, for example `a++` on
548+
* A call to a mutator operator, for example `a++` on
549549
* line 7 in
550550
*
551551
* ```csharp
@@ -560,7 +560,7 @@ class ExtensionOperatorCall extends OperatorCall {
560560
* }
561561
* ```
562562
*/
563-
class MutatorOperatorCall extends OperatorCall {
563+
class MutatorOperatorCall extends MutatorOperation {
564564
MutatorOperatorCall() { mutator_invocation_mode(this, _) }
565565

566566
/** Holds if the operator is in prefix position. */

csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ class UnaryOperation extends Operation, @un_op {
234234
override string toString() { result = this.getOperator() + "..." }
235235
}
236236

237+
/**
238+
* A unary operator call. Either a unary arithmetic operator call (`UnaryArithmeticOperatorCall`),
239+
* a unary bitwise operator call (`UnaryBitwiseOperatorCall`), or a
240+
* unary logical operator call (`UnaryLogicalOperatorCall`).
241+
*/
242+
class UnaryCallOperation extends OperatorCall, UnaryOperation, @un_op_call_expr {
243+
override string toString() { result = UnaryOperation.super.toString() }
244+
}
245+
237246
/**
238247
* A binary operation. Either a binary arithmetic operation
239248
* (`BinaryArithmeticOperation`), a binary bitwise operation

csharp/ql/lib/semmle/code/csharp/exprs/LogicalOperation.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LogicalOperation extends Operation, @log_expr {
1818
/**
1919
* A unary logical operation, that is, a logical 'not' (`LogicalNotExpr`).
2020
*/
21-
class UnaryLogicalOperation extends LogicalOperation, UnaryOperation, @un_log_op_expr { }
21+
class UnaryLogicalOperation extends LogicalOperation, UnaryCallOperation, @un_log_op_expr { }
2222

2323
/**
2424
* A logical 'not', for example `!String.IsNullOrEmpty(s)`.

0 commit comments

Comments
 (0)