File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
test/library-tests/operations Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Provides classes for deref expressions (`*`).
3+ */
4+
5+ private import codeql.rust.elements.PrefixExpr
6+ private import codeql.rust.elements.Operation
7+
8+ /**
9+ * A dereference expression, `*`.
10+ */
11+ final class DerefExpr extends PrefixExpr , Operation {
12+ DerefExpr ( ) { this .getOperatorName ( ) = "*" }
13+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import codeql.rust.elements.ArithmeticOperation
88import codeql.rust.elements.AssignmentOperation
99import codeql.rust.elements.BitwiseOperation
1010import codeql.rust.elements.ComparisonOperation
11+ import codeql.rust.elements.DerefExpr
1112import codeql.rust.elements.LiteralExprExt
1213import codeql.rust.elements.LogicalOperation
1314import codeql.rust.elements.AsyncBlockExpr
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ string describe(Expr op) {
4545 op instanceof BinaryBitwiseOperation and result = "BinaryBitwiseOperation"
4646 or
4747 op instanceof AssignBitwiseOperation and result = "AssignBitwiseOperation"
48+ or
49+ op instanceof DerefExpr and result = "DerefExpr"
4850}
4951
5052module OperationsTest implements TestSig {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ fn test_operations(
4949 x >>= y; // $ Operation Op=>>= Operands=2 AssignmentOperation BinaryExpr BitwiseOperation AssignBitwiseOperation
5050
5151 // miscellaneous expressions that might be operations
52- * ptr; // $ Operation Op=* Operands=1 PrefixExpr
52+ * ptr; // $ Operation Op=* Operands=1 PrefixExpr DerefExpr
5353 & x; // $ RefExpr
5454 res?;
5555
You can’t perform that action at this time.
0 commit comments