Skip to content

Commit 6fccfa3

Browse files
committed
C#: Fix CFG for foreach statements with tuple declarations
1 parent 72b3514 commit 6fccfa3

File tree

7 files changed

+76
-36
lines changed

7 files changed

+76
-36
lines changed

csharp/ql/src/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,8 +1665,9 @@ module ControlFlow {
16651665
}
16661666

16671667
pragma [nomagic]
1668-
private ControlFlowElement lastForeachStmtVariableDeclExpr(ForeachStmt fs, Completion c) {
1669-
result = last(fs.getVariableDeclExpr(), c)
1668+
private ControlFlowElement lastForeachStmtVariableDecl(ForeachStmt fs, Completion c) {
1669+
result = last(fs.getVariableDeclExpr(), c) or
1670+
result = last(fs.getVariableDeclTuple(), c)
16701671
}
16711672

16721673
pragma [nomagic]
@@ -2286,12 +2287,15 @@ module ControlFlow {
22862287
(
22872288
result = first(fs.getVariableDeclExpr())
22882289
or
2290+
result = first(fs.getVariableDeclTuple())
2291+
or
22892292
not exists(fs.getVariableDeclExpr()) and
2293+
not exists(fs.getVariableDeclTuple()) and
22902294
result = first(fs.getBody())
22912295
)
22922296
or
22932297
// Flow from last element of variable declaration to first element of loop body
2294-
cfe = lastForeachStmtVariableDeclExpr(fs, c) and
2298+
cfe = lastForeachStmtVariableDecl(fs, c) and
22952299
c instanceof SimpleCompletion and
22962300
result = first(fs.getBody())
22972301
or

csharp/ql/test/library-tests/controlflow/graph/BasicBlock.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@
234234
| Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:26:36:26:39 | access to parameter args | 3 |
235235
| Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:24:10:24:11 | exit M4 | 1 |
236236
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | 1 |
237-
| Foreach.cs:27:11:27:11 | ; | Foreach.cs:27:11:27:11 | ; | 1 |
237+
| Foreach.cs:26:23:26:23 | String x | Foreach.cs:27:11:27:11 | ; | 4 |
238238
| Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:32:32:32:35 | access to parameter args | 3 |
239239
| Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:30:10:30:11 | exit M5 | 1 |
240240
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | 1 |
241-
| Foreach.cs:33:11:33:11 | ; | Foreach.cs:33:11:33:11 | ; | 1 |
241+
| Foreach.cs:32:23:32:23 | String x | Foreach.cs:33:11:33:11 | ; | 4 |
242242
| Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:38:39:38:42 | access to parameter args | 3 |
243243
| Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:36:10:36:11 | exit M6 | 1 |
244244
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | 1 |
245-
| Foreach.cs:39:11:39:11 | ; | Foreach.cs:39:11:39:11 | ; | 1 |
245+
| Foreach.cs:38:26:38:26 | String x | Foreach.cs:39:11:39:11 | ; | 4 |
246246
| Initializers.cs:6:5:6:16 | enter Initializers | Initializers.cs:6:5:6:16 | exit Initializers | 3 |
247247
| Initializers.cs:8:10:8:10 | enter M | Initializers.cs:8:10:8:10 | exit M | 23 |
248248
| NullCoalescing.cs:3:9:3:10 | enter M1 | NullCoalescing.cs:3:23:3:23 | access to parameter i | 3 |

csharp/ql/test/library-tests/controlflow/graph/BasicBlockDominance.expected

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -481,29 +481,29 @@
481481
| post | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:24:10:24:11 | enter M4 |
482482
| post | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:24:10:24:11 | exit M4 |
483483
| post | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... |
484-
| post | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:27:11:27:11 | ; |
484+
| post | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:26:23:26:23 | String x |
485485
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:24:10:24:11 | enter M4 |
486486
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... |
487-
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; |
488-
| post | Foreach.cs:27:11:27:11 | ; | Foreach.cs:27:11:27:11 | ; |
487+
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:23:26:23 | String x |
488+
| post | Foreach.cs:26:23:26:23 | String x | Foreach.cs:26:23:26:23 | String x |
489489
| post | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:30:10:30:11 | enter M5 |
490490
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:30:10:30:11 | enter M5 |
491491
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:30:10:30:11 | exit M5 |
492492
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
493-
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:33:11:33:11 | ; |
493+
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:32:23:32:23 | String x |
494494
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:30:10:30:11 | enter M5 |
495495
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
496-
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; |
497-
| post | Foreach.cs:33:11:33:11 | ; | Foreach.cs:33:11:33:11 | ; |
496+
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:23:32:23 | String x |
497+
| post | Foreach.cs:32:23:32:23 | String x | Foreach.cs:32:23:32:23 | String x |
498498
| post | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:36:10:36:11 | enter M6 |
499499
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:36:10:36:11 | enter M6 |
500500
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:36:10:36:11 | exit M6 |
501501
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
502-
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:39:11:39:11 | ; |
502+
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:38:26:38:26 | String x |
503503
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:36:10:36:11 | enter M6 |
504504
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
505-
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; |
506-
| post | Foreach.cs:39:11:39:11 | ; | Foreach.cs:39:11:39:11 | ; |
505+
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:26:38:26 | String x |
506+
| post | Foreach.cs:38:26:38:26 | String x | Foreach.cs:38:26:38:26 | String x |
507507
| post | Initializers.cs:6:5:6:16 | enter Initializers | Initializers.cs:6:5:6:16 | enter Initializers |
508508
| post | Initializers.cs:8:10:8:10 | enter M | Initializers.cs:8:10:8:10 | enter M |
509509
| post | NullCoalescing.cs:3:9:3:10 | enter M1 | NullCoalescing.cs:3:9:3:10 | enter M1 |
@@ -1886,30 +1886,30 @@
18861886
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:24:10:24:11 | enter M4 |
18871887
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:24:10:24:11 | exit M4 |
18881888
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... |
1889-
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:27:11:27:11 | ; |
1889+
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:26:23:26:23 | String x |
18901890
| pre | Foreach.cs:24:10:24:11 | exit M4 | Foreach.cs:24:10:24:11 | exit M4 |
18911891
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:24:10:24:11 | exit M4 |
18921892
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... |
1893-
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; |
1894-
| pre | Foreach.cs:27:11:27:11 | ; | Foreach.cs:27:11:27:11 | ; |
1893+
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:23:26:23 | String x |
1894+
| pre | Foreach.cs:26:23:26:23 | String x | Foreach.cs:26:23:26:23 | String x |
18951895
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:30:10:30:11 | enter M5 |
18961896
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:30:10:30:11 | exit M5 |
18971897
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
1898-
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:33:11:33:11 | ; |
1898+
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:32:23:32:23 | String x |
18991899
| pre | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:30:10:30:11 | exit M5 |
19001900
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:30:10:30:11 | exit M5 |
19011901
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
1902-
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; |
1903-
| pre | Foreach.cs:33:11:33:11 | ; | Foreach.cs:33:11:33:11 | ; |
1902+
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:23:32:23 | String x |
1903+
| pre | Foreach.cs:32:23:32:23 | String x | Foreach.cs:32:23:32:23 | String x |
19041904
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:36:10:36:11 | enter M6 |
19051905
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:36:10:36:11 | exit M6 |
19061906
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
1907-
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:39:11:39:11 | ; |
1907+
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:38:26:38:26 | String x |
19081908
| pre | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:36:10:36:11 | exit M6 |
19091909
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:36:10:36:11 | exit M6 |
19101910
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
1911-
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; |
1912-
| pre | Foreach.cs:39:11:39:11 | ; | Foreach.cs:39:11:39:11 | ; |
1911+
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:26:38:26 | String x |
1912+
| pre | Foreach.cs:38:26:38:26 | String x | Foreach.cs:38:26:38:26 | String x |
19131913
| pre | Initializers.cs:6:5:6:16 | enter Initializers | Initializers.cs:6:5:6:16 | enter Initializers |
19141914
| pre | Initializers.cs:8:10:8:10 | enter M | Initializers.cs:8:10:8:10 | enter M |
19151915
| pre | NullCoalescing.cs:3:9:3:10 | enter M1 | NullCoalescing.cs:3:9:3:10 | enter M1 |

csharp/ql/test/library-tests/controlflow/graph/ConditionBlock.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@
184184
| Foreach.cs:20:9:21:11 | foreach (... ... in ...) ... | Foreach.cs:20:22:20:22 | String x | false |
185185
| Foreach.cs:20:27:20:27 | access to parameter e | Foreach.cs:20:29:20:38 | call to method ToArray | false |
186186
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:24:10:24:11 | exit M4 | true |
187-
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; | false |
187+
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:23:26:23 | String x | false |
188188
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:30:10:30:11 | exit M5 | true |
189-
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; | false |
189+
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:23:32:23 | String x | false |
190190
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:36:10:36:11 | exit M6 | true |
191-
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; | false |
191+
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:26:38:26 | String x | false |
192192
| NullCoalescing.cs:3:23:3:23 | access to parameter i | NullCoalescing.cs:3:28:3:28 | 0 | true |
193193
| NullCoalescing.cs:5:25:5:25 | access to parameter b | NullCoalescing.cs:5:30:5:34 | false | true |
194194
| NullCoalescing.cs:5:25:5:25 | access to parameter b | NullCoalescing.cs:5:39:5:39 | 0 | true |

csharp/ql/test/library-tests/controlflow/graph/Dominance.expected

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,17 +876,26 @@
876876
| post | Foreach.cs:25:5:28:5 | {...} | Foreach.cs:24:10:24:11 | enter M4 |
877877
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:36:26:39 | access to parameter args |
878878
| post | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; |
879+
| post | Foreach.cs:26:18:26:31 | (..., ...) | Foreach.cs:26:30:26:30 | Int32 y |
880+
| post | Foreach.cs:26:30:26:30 | Int32 y | Foreach.cs:26:23:26:23 | String x |
879881
| post | Foreach.cs:26:36:26:39 | access to parameter args | Foreach.cs:25:5:28:5 | {...} |
882+
| post | Foreach.cs:27:11:27:11 | ; | Foreach.cs:26:18:26:31 | (..., ...) |
880883
| post | Foreach.cs:30:10:30:11 | exit M5 | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
881884
| post | Foreach.cs:31:5:34:5 | {...} | Foreach.cs:30:10:30:11 | enter M5 |
882885
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:32:32:35 | access to parameter args |
883886
| post | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; |
887+
| post | Foreach.cs:32:18:32:27 | (..., ...) | Foreach.cs:32:26:32:26 | Int32 y |
888+
| post | Foreach.cs:32:26:32:26 | Int32 y | Foreach.cs:32:23:32:23 | String x |
884889
| post | Foreach.cs:32:32:32:35 | access to parameter args | Foreach.cs:31:5:34:5 | {...} |
890+
| post | Foreach.cs:33:11:33:11 | ; | Foreach.cs:32:18:32:27 | (..., ...) |
885891
| post | Foreach.cs:36:10:36:11 | exit M6 | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
886892
| post | Foreach.cs:37:5:40:5 | {...} | Foreach.cs:36:10:36:11 | enter M6 |
887893
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:39:38:42 | access to parameter args |
888894
| post | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; |
895+
| post | Foreach.cs:38:18:38:34 | (..., ...) | Foreach.cs:38:33:38:33 | Int32 y |
896+
| post | Foreach.cs:38:33:38:33 | Int32 y | Foreach.cs:38:26:38:26 | String x |
889897
| post | Foreach.cs:38:39:38:42 | access to parameter args | Foreach.cs:37:5:40:5 | {...} |
898+
| post | Foreach.cs:39:11:39:11 | ; | Foreach.cs:38:18:38:34 | (..., ...) |
890899
| post | Initializers.cs:6:5:6:16 | exit Initializers | Initializers.cs:6:28:6:30 | {...} |
891900
| post | Initializers.cs:6:28:6:30 | {...} | Initializers.cs:6:5:6:16 | enter Initializers |
892901
| post | Initializers.cs:8:10:8:10 | exit M | Initializers.cs:11:13:11:63 | Initializers[] iz = ... |
@@ -3111,17 +3120,26 @@
31113120
| pre | Foreach.cs:24:10:24:11 | enter M4 | Foreach.cs:25:5:28:5 | {...} |
31123121
| pre | Foreach.cs:25:5:28:5 | {...} | Foreach.cs:26:36:26:39 | access to parameter args |
31133122
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:24:10:24:11 | exit M4 |
3114-
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; |
3123+
| pre | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:23:26:23 | String x |
3124+
| pre | Foreach.cs:26:18:26:31 | (..., ...) | Foreach.cs:27:11:27:11 | ; |
3125+
| pre | Foreach.cs:26:23:26:23 | String x | Foreach.cs:26:30:26:30 | Int32 y |
3126+
| pre | Foreach.cs:26:30:26:30 | Int32 y | Foreach.cs:26:18:26:31 | (..., ...) |
31153127
| pre | Foreach.cs:26:36:26:39 | access to parameter args | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... |
31163128
| pre | Foreach.cs:30:10:30:11 | enter M5 | Foreach.cs:31:5:34:5 | {...} |
31173129
| pre | Foreach.cs:31:5:34:5 | {...} | Foreach.cs:32:32:32:35 | access to parameter args |
31183130
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:30:10:30:11 | exit M5 |
3119-
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; |
3131+
| pre | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:23:32:23 | String x |
3132+
| pre | Foreach.cs:32:18:32:27 | (..., ...) | Foreach.cs:33:11:33:11 | ; |
3133+
| pre | Foreach.cs:32:23:32:23 | String x | Foreach.cs:32:26:32:26 | Int32 y |
3134+
| pre | Foreach.cs:32:26:32:26 | Int32 y | Foreach.cs:32:18:32:27 | (..., ...) |
31203135
| pre | Foreach.cs:32:32:32:35 | access to parameter args | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... |
31213136
| pre | Foreach.cs:36:10:36:11 | enter M6 | Foreach.cs:37:5:40:5 | {...} |
31223137
| pre | Foreach.cs:37:5:40:5 | {...} | Foreach.cs:38:39:38:42 | access to parameter args |
31233138
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:36:10:36:11 | exit M6 |
3124-
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; |
3139+
| pre | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:26:38:26 | String x |
3140+
| pre | Foreach.cs:38:18:38:34 | (..., ...) | Foreach.cs:39:11:39:11 | ; |
3141+
| pre | Foreach.cs:38:26:38:26 | String x | Foreach.cs:38:33:38:33 | Int32 y |
3142+
| pre | Foreach.cs:38:33:38:33 | Int32 y | Foreach.cs:38:18:38:34 | (..., ...) |
31253143
| pre | Foreach.cs:38:39:38:42 | access to parameter args | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... |
31263144
| pre | Initializers.cs:6:5:6:16 | enter Initializers | Initializers.cs:6:28:6:30 | {...} |
31273145
| pre | Initializers.cs:6:28:6:30 | {...} | Initializers.cs:6:5:6:16 | exit Initializers |

csharp/ql/test/library-tests/controlflow/graph/ElementGraph.expected

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,15 +665,24 @@
665665
| Foreach.cs:20:43:20:68 | call to method Empty | Foreach.cs:20:9:21:11 | foreach (... ... in ...) ... | semmle.label | successor |
666666
| Foreach.cs:21:11:21:11 | ; | Foreach.cs:20:9:21:11 | foreach (... ... in ...) ... | semmle.label | successor |
667667
| Foreach.cs:25:5:28:5 | {...} | Foreach.cs:26:36:26:39 | access to parameter args | semmle.label | successor |
668-
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:27:11:27:11 | ; | semmle.label | non-empty |
668+
| Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | Foreach.cs:26:23:26:23 | String x | semmle.label | non-empty |
669+
| Foreach.cs:26:18:26:31 | (..., ...) | Foreach.cs:27:11:27:11 | ; | semmle.label | successor |
670+
| Foreach.cs:26:23:26:23 | String x | Foreach.cs:26:30:26:30 | Int32 y | semmle.label | successor |
671+
| Foreach.cs:26:30:26:30 | Int32 y | Foreach.cs:26:18:26:31 | (..., ...) | semmle.label | successor |
669672
| Foreach.cs:26:36:26:39 | access to parameter args | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | semmle.label | successor |
670673
| Foreach.cs:27:11:27:11 | ; | Foreach.cs:26:9:27:11 | foreach (... ... in ...) ... | semmle.label | successor |
671674
| Foreach.cs:31:5:34:5 | {...} | Foreach.cs:32:32:32:35 | access to parameter args | semmle.label | successor |
672-
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:33:11:33:11 | ; | semmle.label | non-empty |
675+
| Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | Foreach.cs:32:23:32:23 | String x | semmle.label | non-empty |
676+
| Foreach.cs:32:18:32:27 | (..., ...) | Foreach.cs:33:11:33:11 | ; | semmle.label | successor |
677+
| Foreach.cs:32:23:32:23 | String x | Foreach.cs:32:26:32:26 | Int32 y | semmle.label | successor |
678+
| Foreach.cs:32:26:32:26 | Int32 y | Foreach.cs:32:18:32:27 | (..., ...) | semmle.label | successor |
673679
| Foreach.cs:32:32:32:35 | access to parameter args | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | semmle.label | successor |
674680
| Foreach.cs:33:11:33:11 | ; | Foreach.cs:32:9:33:11 | foreach (... ... in ...) ... | semmle.label | successor |
675681
| Foreach.cs:37:5:40:5 | {...} | Foreach.cs:38:39:38:42 | access to parameter args | semmle.label | successor |
676-
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:39:11:39:11 | ; | semmle.label | non-empty |
682+
| Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | Foreach.cs:38:26:38:26 | String x | semmle.label | non-empty |
683+
| Foreach.cs:38:18:38:34 | (..., ...) | Foreach.cs:39:11:39:11 | ; | semmle.label | successor |
684+
| Foreach.cs:38:26:38:26 | String x | Foreach.cs:38:33:38:33 | Int32 y | semmle.label | successor |
685+
| Foreach.cs:38:33:38:33 | Int32 y | Foreach.cs:38:18:38:34 | (..., ...) | semmle.label | successor |
677686
| Foreach.cs:38:39:38:42 | access to parameter args | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | semmle.label | successor |
678687
| Foreach.cs:39:11:39:11 | ; | Foreach.cs:38:9:39:11 | foreach (... ... in ...) ... | semmle.label | successor |
679688
| Initializers.cs:9:5:12:5 | {...} | Initializers.cs:10:9:10:54 | ... ...; | semmle.label | successor |

0 commit comments

Comments
 (0)