Skip to content

Commit dc280c6

Browse files
committed
Rust: Add missing assignment class relations.
1 parent b22ce55 commit dc280c6

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

rust/ql/lib/codeql/rust/elements/ArithmeticOperation.qll

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
private import codeql.rust.elements.BinaryExpr
66
private import codeql.rust.elements.PrefixExpr
77
private import codeql.rust.elements.Operation
8+
private import codeql.rust.elements.AssignmentOperation
89

910
/**
1011
* An arithmetic operation, such as `+`, `*=`, or `-`.
@@ -17,25 +18,21 @@ final class ArithmeticOperation = ArithmeticOperationImpl;
1718
* A binary arithmetic operation, such as `+` or `*`.
1819
*/
1920
final class BinaryArithmeticOperation extends BinaryExpr, ArithmeticOperationImpl {
20-
BinaryArithmeticOperation() {
21-
this.getOperatorName() = ["+", "-", "*", "/", "%"]
22-
}
21+
BinaryArithmeticOperation() { this.getOperatorName() = ["+", "-", "*", "/", "%"] }
2322
}
2423

2524
/**
2625
* An arithmetic assignment operation, such as `+=` or `*=`.
2726
*/
28-
final class AssignArithmeticOperation extends BinaryExpr, ArithmeticOperationImpl {
29-
AssignArithmeticOperation() {
30-
this.getOperatorName() = ["+=", "-=", "*=", "/=", "%="]
31-
}
27+
final class AssignArithmeticOperation extends BinaryExpr, ArithmeticOperationImpl,
28+
AssignmentOperation
29+
{
30+
AssignArithmeticOperation() { this.getOperatorName() = ["+=", "-=", "*=", "/=", "%="] }
3231
}
3332

3433
/**
3534
* A prefix arithmetic operation, such as `-`.
3635
*/
3736
final class PrefixArithmeticOperation extends PrefixExpr, ArithmeticOperationImpl {
38-
PrefixArithmeticOperation() {
39-
this.getOperatorName() = "-"
40-
}
37+
PrefixArithmeticOperation() { this.getOperatorName() = "-" }
4138
}

rust/ql/lib/codeql/rust/elements/BitwiseOperation.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
private import codeql.rust.elements.BinaryExpr
66
private import codeql.rust.elements.Operation
7+
private import codeql.rust.elements.AssignmentOperation
78

89
/**
910
* A bitwise operation, such as `&`, `<<`, or `|=`.
@@ -22,6 +23,6 @@ final class BinaryBitwiseOperation extends BinaryExpr, BitwiseOperationImpl {
2223
/**
2324
* A bitwise assignment operation, such as `|=` or `<<=`.
2425
*/
25-
final class AssignBitwiseOperation extends BinaryExpr, BitwiseOperationImpl {
26+
final class AssignBitwiseOperation extends BinaryExpr, BitwiseOperationImpl, AssignmentOperation {
2627
AssignBitwiseOperation() { this.getOperatorName() = ["&=", "|=", "^=", "<<=", ">>="] }
2728
}

0 commit comments

Comments
 (0)