Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,489 changes: 1,489 additions & 0 deletions csharp/downgrades/e73ca2c93df8aae162f1704edc4817a5cb330529/old.dbscheme

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: Remove inclusion of @assign_expr in @bin_op
compatibility: full
6 changes: 5 additions & 1 deletion csharp/ql/lib/semmle/code/csharp/exprs/Assignment.qll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Expr
* (`LocalVariableDeclAndInitExpr`), a simple assignment (`AssignExpr`), or
* an assignment operation (`AssignOperation`).
*/
class Assignment extends Operation, @assign_expr {
class Assignment extends BinaryOperation, @assign_expr {
Assignment() {
this instanceof LocalVariableDeclExpr
implies
Expand All @@ -20,6 +20,10 @@ class Assignment extends Operation, @assign_expr {
expr_parent(_, 0, this)
}

override Expr getLeftOperand() { result = this.getChild(1) }

override Expr getRightOperand() { result = this.getChild(0) }

/** Gets the left operand of this assignment. */
Expr getLValue() { result = this.getChild(1) }

Expand Down
3 changes: 2 additions & 1 deletion csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ class UnaryOperation extends Operation, @un_op {
* A binary operation. Either a binary arithmetic operation
* (`BinaryArithmeticOperation`), a binary bitwise operation
* (`BinaryBitwiseOperation`), a comparison operation (`ComparisonOperation`),
* or a binary logical operation (`BinaryLogicalOperation`).
* a binary logical operation (`BinaryLogicalOperation`), or an
* assignment (`Assignment`).
*/
class BinaryOperation extends Operation, @bin_op {
/** Gets the left operand of this binary operation. */
Expand Down
4 changes: 2 additions & 2 deletions csharp/ql/lib/semmlecode.csharp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,10 @@ case @expr.kind of
@rel_op_expr = @gt_expr | @lt_expr| @ge_expr | @le_expr;
@comp_expr = @equality_op_expr | @rel_op_expr;

@op_expr = @assign_expr | @un_op | @bin_op | @ternary_op;
@op_expr = @un_op | @bin_op | @ternary_op;

@ternary_op = @ternary_log_op_expr;
@bin_op = @bin_arith_op_expr | @bin_log_op_expr | @bin_bit_op_expr | @comp_expr;
@bin_op = @assign_expr | @bin_arith_op_expr | @bin_log_op_expr | @bin_bit_op_expr | @comp_expr;
@un_op = @un_arith_op_expr | @un_log_op_expr | @un_bit_op_expr | @sizeof_expr
| @pointer_indirection_expr | @address_of_expr;

Expand Down
Loading