mirror of
https://github.com/github/codeql.git
synced 2026-04-18 21:44:02 +02:00
Rust: Step correctly over method arguments
Previously the math was wrong and the first argument (with `i` being `0`) had two edges out of it.
This commit is contained in:
@@ -524,10 +524,7 @@ class MatchExprTree extends PostOrderTree instanceof MatchExpr {
|
||||
|
||||
class MethodCallExprTree extends StandardPostOrderTree, MethodCallExpr {
|
||||
override AstNode getChildNode(int i) {
|
||||
i = 0 and
|
||||
result = this.getReceiver()
|
||||
or
|
||||
result = this.getArgList().getArg(i + 1)
|
||||
if i = 0 then result = this.getReceiver() else result = this.getArgList().getArg(i - 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ edges
|
||||
| test.rs:10:13:10:19 | map | test.rs:11:9:11:28 | ExprStmt | match |
|
||||
| test.rs:10:23:10:34 | PathExpr | test.rs:10:23:10:36 | CallExpr | |
|
||||
| test.rs:10:23:10:36 | CallExpr | test.rs:10:13:10:19 | map | |
|
||||
| test.rs:11:9:11:11 | map | test.rs:11:9:11:27 | MethodCallExpr | |
|
||||
| test.rs:11:9:11:11 | map | test.rs:11:20:11:21 | 37 | |
|
||||
| test.rs:11:9:11:27 | MethodCallExpr | test.rs:9:22:12:5 | BlockExpr | |
|
||||
| test.rs:11:9:11:28 | ExprStmt | test.rs:11:20:11:21 | 37 | |
|
||||
| test.rs:11:20:11:21 | 37 | test.rs:11:9:11:11 | map | |
|
||||
| test.rs:11:9:11:28 | ExprStmt | test.rs:11:9:11:11 | map | |
|
||||
| test.rs:11:20:11:21 | 37 | test.rs:11:24:11:26 | "a" | |
|
||||
| test.rs:11:24:11:26 | "a" | test.rs:11:9:11:27 | MethodCallExpr | |
|
||||
| test.rs:17:5:33:5 | enter test_break_and_continue | test.rs:17:32:17:32 | n | |
|
||||
|
||||
@@ -707,10 +707,10 @@ edges
|
||||
| variables.rs:332:5:332:17 | ExprStmt | variables.rs:332:5:332:13 | PathExpr | |
|
||||
| variables.rs:332:15:332:15 | a | variables.rs:332:5:332:16 | CallExpr | |
|
||||
| variables.rs:333:5:333:27 | MethodCallExpr | variables.rs:334:5:334:17 | ExprStmt | |
|
||||
| variables.rs:333:5:333:28 | ExprStmt | variables.rs:333:25:333:26 | 10 | |
|
||||
| variables.rs:333:6:333:11 | RefExpr | variables.rs:333:5:333:27 | MethodCallExpr | |
|
||||
| variables.rs:333:5:333:28 | ExprStmt | variables.rs:333:11:333:11 | a | |
|
||||
| variables.rs:333:6:333:11 | RefExpr | variables.rs:333:25:333:26 | 10 | |
|
||||
| variables.rs:333:11:333:11 | a | variables.rs:333:6:333:11 | RefExpr | |
|
||||
| variables.rs:333:25:333:26 | 10 | variables.rs:333:11:333:11 | a | |
|
||||
| variables.rs:333:25:333:26 | 10 | variables.rs:333:5:333:27 | MethodCallExpr | |
|
||||
| variables.rs:334:5:334:13 | PathExpr | variables.rs:334:15:334:15 | a | |
|
||||
| variables.rs:334:5:334:16 | CallExpr | variables.rs:329:17:335:1 | BlockExpr | |
|
||||
| variables.rs:334:5:334:17 | ExprStmt | variables.rs:334:5:334:13 | PathExpr | |
|
||||
|
||||
Reference in New Issue
Block a user