Skip to content

Commit 8522039

Browse files
committed
Rust: Equal -> Equals.
1 parent 4ebf3ad commit 8522039

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ final class EqualityOperation = EqualityOperationImpl;
2222
/**
2323
* The equal comparison operation, `==`.
2424
*/
25-
final class EqualOperation extends EqualityOperationImpl {
26-
EqualOperation() { this.getOperatorName() = "==" }
25+
final class EqualsOperation extends EqualityOperationImpl {
26+
EqualsOperation() { this.getOperatorName() = "==" }
2727
}
2828

2929
/**
3030
* The not equal comparison operation, `!=`.
3131
*/
32-
final class NotEqualOperation extends EqualityOperationImpl {
33-
NotEqualOperation() { this.getOperatorName() = "!=" }
32+
final class NotEqualsOperation extends EqualityOperationImpl {
33+
NotEqualsOperation() { this.getOperatorName() = "!=" }
3434
}
3535

3636
/**
@@ -81,8 +81,8 @@ final class GreaterThanOperation extends RelationalOperationImpl {
8181
/**
8282
* The less than or equal comparison operation, `<=`.
8383
*/
84-
final class LessOrEqualOperation extends RelationalOperationImpl {
85-
LessOrEqualOperation() { this.getOperatorName() = "<=" }
84+
final class LessOrEqualsOperation extends RelationalOperationImpl {
85+
LessOrEqualsOperation() { this.getOperatorName() = "<=" }
8686

8787
override Expr getGreaterOperand() { result = this.getRhs() }
8888

@@ -92,8 +92,8 @@ final class LessOrEqualOperation extends RelationalOperationImpl {
9292
/**
9393
* The greater than or equal comparison operation, `>=`.
9494
*/
95-
final class GreaterOrEqualOperation extends RelationalOperationImpl {
96-
GreaterOrEqualOperation() { this.getOperatorName() = ">=" }
95+
final class GreaterOrEqualsOperation extends RelationalOperationImpl {
96+
GreaterOrEqualsOperation() { this.getOperatorName() = ">=" }
9797

9898
override Expr getGreaterOperand() { result = this.getLhs() }
9999

rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ module UncontrolledAllocationSize {
5555
node = cmp.(RelationalOperation).getGreaterOperand().getACfgNode() and
5656
branch = false
5757
or
58-
cmp instanceof EqualOperation and
58+
cmp instanceof EqualsOperation and
5959
[cmp.getLhs(), cmp.getRhs()].getACfgNode() = node and
6060
branch = true
6161
or
62-
cmp instanceof NotEqualOperation and
62+
cmp instanceof NotEqualsOperation and
6363
[cmp.getLhs(), cmp.getRhs()].getACfgNode() = node and
6464
branch = false
6565
)

rust/ql/test/library-tests/operations/Operations.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ string describe(Expr op) {
1818
or
1919
op instanceof EqualityOperation and result = "EqualityOperation"
2020
or
21-
op instanceof EqualOperation and result = "EqualOperation"
21+
op instanceof EqualsOperation and result = "EqualsOperation"
2222
or
23-
op instanceof NotEqualOperation and result = "NotEqualOperation"
23+
op instanceof NotEqualsOperation and result = "NotEqualsOperation"
2424
or
2525
op instanceof RelationalOperation and result = "RelationalOperation"
2626
or
2727
op instanceof LessThanOperation and result = "LessThanOperation"
2828
or
2929
op instanceof GreaterThanOperation and result = "GreaterThanOperation"
3030
or
31-
op instanceof LessOrEqualOperation and result = "LessOrEqualOperation"
31+
op instanceof LessOrEqualsOperation and result = "LessOrEqualsOperation"
3232
or
33-
op instanceof GreaterOrEqualOperation and result = "GreaterOrEqualOperation"
33+
op instanceof GreaterOrEqualsOperation and result = "GreaterOrEqualsOperation"
3434
}
3535

3636
module OperationsTest implements TestSig {

rust/ql/test/library-tests/operations/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ fn test_operations(
1111
x = y; // $ Operation Op== Operands=2 AssignmentOperation BinaryExpr
1212

1313
// comparison operations
14-
x == y; // $ Operation Op=== Operands=2 BinaryExpr ComparisonOperation EqualityOperation EqualOperation
15-
x != y; // $ Operation Op=!= Operands=2 BinaryExpr ComparisonOperation EqualityOperation NotEqualOperation
14+
x == y; // $ Operation Op=== Operands=2 BinaryExpr ComparisonOperation EqualityOperation EqualsOperation
15+
x != y; // $ Operation Op=!= Operands=2 BinaryExpr ComparisonOperation EqualityOperation NotEqualsOperation
1616
x < y; // $ Operation Op=< Operands=2 BinaryExpr ComparisonOperation RelationalOperation LessThanOperation Greater=y Lesser=x
17-
x <= y; // $ Operation Op=<= Operands=2 BinaryExpr ComparisonOperation RelationalOperation LessOrEqualOperation Greater=y Lesser=x
17+
x <= y; // $ Operation Op=<= Operands=2 BinaryExpr ComparisonOperation RelationalOperation LessOrEqualsOperation Greater=y Lesser=x
1818
x > y; // $ Operation Op=> Operands=2 BinaryExpr ComparisonOperation RelationalOperation GreaterThanOperation Greater=x Lesser=y
19-
x >= y; // $ Operation Op=>= Operands=2 BinaryExpr ComparisonOperation RelationalOperation GreaterOrEqualOperation Greater=x Lesser=y
19+
x >= y; // $ Operation Op=>= Operands=2 BinaryExpr ComparisonOperation RelationalOperation GreaterOrEqualsOperation Greater=x Lesser=y
2020

2121
// arithmetic operations
2222
x + y; // $ Operation Op=+ Operands=2 BinaryExpr

0 commit comments

Comments
 (0)