Skip to content

Commit 9f1a48f

Browse files
committed
Accept test result changes
Category 1 — GVN named-result zero-init: Named result variables now get an explicit result-zero-init:0 node (the migrated CFG models result vars as zero-initialized in the prologue). Test passes; intended modeling. Category 2 — ParenExpr (...) missingInNodeForPostOrInOrder. postOrInOrder starts with n instanceof Go::ReferenceExpr, and ReferenceExpr includes the this.(ParenExpr).getExpr() instanceof ReferenceExpr disjunct, so parenthesized reference expressions are correctly treated pre-order and excluded. Accepted. Category 3 — select multipleSuccessors/deadEnd: Same pattern already accepted in the committed ControlFlowGraph consistency file. Category 4 — defer-invoke / after-block multipleSuccessors: A return/after-block node flows both to Normal Exit and into the deferred-call chain. Already accepted in committed ControlFlowGraph and experimental/InconsistentCode.
1 parent c417e32 commit 9f1a48f

8 files changed

Lines changed: 68 additions & 3 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
consistencyOverview
2+
| deadEnd | 1 |
3+
| multipleSuccessors | 6 |
4+
deadEnd
5+
| input.go:61:2:61:10 | select statement |
6+
multipleSuccessors
7+
| input.go:50:2:59:2 | select statement | successor | input.go:51:2:52:31 | comm clause |
8+
| input.go:50:2:59:2 | select statement | successor | input.go:53:2:55:16 | comm clause |
9+
| input.go:50:2:59:2 | select statement | successor | input.go:56:2:57:15 | comm clause |
10+
| input.go:50:2:59:2 | select statement | successor | input.go:58:2:58:16 | comm clause |
11+
| input.go:71:2:71:10 | return statement | successor | input.go:67:9:67:35 | defer-invoke function call |
12+
| input.go:71:2:71:10 | return statement | successor | input.go:69:9:69:36 | defer-invoke function call |

go/ql/test/library-tests/semmle/go/dataflow/GlobalValueNumbering/GlobalValueNumber.expected

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@
1919
| main.go:19:10:19:24 | "Hello, world!" | main.go:19:10:19:24 | "Hello, world!" |
2020
| main.go:20:2:20:16 | call to Println | main.go:20:2:20:16 | call to Println |
2121
| main.go:23:23:26:1 | result-read:0 block statement | main.go:24:8:24:8 | 4 |
22+
| main.go:23:23:26:1 | result-zero-init:0 block statement | main.go:10:7:10:7 | 0 |
2223
| main.go:24:2:24:8 | SSA def(res) | main.go:24:8:24:8 | 4 |
2324
| main.go:24:8:24:8 | 4 | main.go:24:8:24:8 | 4 |
24-
| main.go:28:24:31:1 | result-read:0 block statement | main.go:29:8:29:8 | 5 |
25-
| main.go:29:2:29:8 | SSA def(res) | main.go:29:8:29:8 | 5 |
25+
| main.go:28:24:31:1 | result-read:0 block statement | main.go:30:9:30:9 | 6 |
26+
| main.go:28:24:31:1 | result-zero-init:0 block statement | main.go:10:7:10:7 | 0 |
2627
| main.go:29:8:29:8 | 5 | main.go:29:8:29:8 | 5 |
28+
| main.go:30:2:30:9 | SSA def(res) | main.go:30:9:30:9 | 6 |
2729
| main.go:30:9:30:9 | 6 | main.go:30:9:30:9 | 6 |
28-
| main.go:34:2:34:8 | SSA def(res) | main.go:34:8:34:8 | 7 |
30+
| main.go:33:24:39:1 | result-zero-init:0 block statement | main.go:10:7:10:7 | 0 |
2931
| main.go:34:8:34:8 | 7 | main.go:34:8:34:8 | 7 |
3032
| main.go:35:8:37:4 | defer-invoke function call | main.go:35:8:37:4 | function call |
3133
| main.go:36:3:36:9 | SSA def(res) | main.go:36:9:36:9 | 8 |
3234
| main.go:36:9:36:9 | 8 | main.go:36:9:36:9 | 8 |
35+
| main.go:38:2:38:9 | SSA def(res) | main.go:38:9:38:9 | 9 |
3336
| main.go:38:9:38:9 | 9 | main.go:38:9:38:9 | 9 |
3437
| regressions.go:5:11:5:31 | call to Sizeof | regressions.go:5:11:5:31 | call to Sizeof |
3538
| regressions.go:5:25:5:30 | call to test | regressions.go:5:25:5:30 | call to test |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
consistencyOverview
2+
| missingInNodeForPostOrInOrder | 2 |
3+
missingInNodeForPostOrInOrder
4+
| main.go:40:2:40:8 | (...) |
5+
| main.go:41:11:41:17 | (...) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
consistencyOverview
2+
| missingInNodeForPostOrInOrder | 2 |
3+
missingInNodeForPostOrInOrder
4+
| testDeprecatedApi.go:169:13:169:20 | (...) |
5+
| testModernApi.go:226:13:226:20 | (...) |
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
consistencyOverview
2+
| multipleSuccessors | 6 |
3+
multipleSuccessors
4+
| tests.go:94:30:105:1 | After block statement | successor | tests.go:94:1:105:1 | Normal Exit |
5+
| tests.go:94:30:105:1 | After block statement | successor | tests.go:99:9:99:17 | defer-invoke call to Close |
6+
| tests.go:107:31:120:1 | After block statement | successor | tests.go:107:1:120:1 | Normal Exit |
7+
| tests.go:107:31:120:1 | After block statement | successor | tests.go:112:9:112:17 | defer-invoke call to Close |
8+
| tests.go:122:46:137:1 | After block statement | successor | tests.go:122:1:137:1 | Normal Exit |
9+
| tests.go:122:46:137:1 | After block statement | successor | tests.go:126:9:126:17 | defer-invoke call to Close |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
consistencyOverview
2+
| multipleSuccessors | 10 |
3+
multipleSuccessors
4+
| testdata.go:418:2:423:2 | select statement | successor | testdata.go:419:2:420:7 | comm clause |
5+
| testdata.go:418:2:423:2 | select statement | successor | testdata.go:421:2:422:7 | comm clause |
6+
| testdata.go:430:2:437:2 | select statement | successor | testdata.go:431:2:432:17 | comm clause |
7+
| testdata.go:430:2:437:2 | select statement | successor | testdata.go:433:2:434:17 | comm clause |
8+
| testdata.go:430:2:437:2 | select statement | successor | testdata.go:435:2:436:7 | comm clause |
9+
| testdata.go:443:2:450:2 | select statement | successor | testdata.go:444:2:445:7 | comm clause |
10+
| testdata.go:443:2:450:2 | select statement | successor | testdata.go:446:2:447:7 | comm clause |
11+
| testdata.go:443:2:450:2 | select statement | successor | testdata.go:448:2:449:7 | comm clause |
12+
| testdata.go:457:2:462:2 | select statement | successor | testdata.go:458:2:459:7 | comm clause |
13+
| testdata.go:457:2:462:2 | select statement | successor | testdata.go:460:2:461:7 | comm clause |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
consistencyOverview
2+
| deadEnd | 9 |
3+
deadEnd
4+
| main.go:17:2:17:10 | select statement |
5+
| main.go:109:2:109:10 | select statement |
6+
| main.go:115:2:115:10 | select statement |
7+
| main.go:126:2:126:10 | select statement |
8+
| main.go:132:2:132:10 | select statement |
9+
| main.go:138:2:138:10 | select statement |
10+
| main.go:145:2:145:10 | select statement |
11+
| main.go:151:2:151:10 | select statement |
12+
| main.go:157:2:157:10 | select statement |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
consistencyOverview
2+
| missingInNodeForPostOrInOrder | 3 |
3+
missingInNodeForPostOrInOrder
4+
| main.go:49:2:49:15 | (...) |
5+
| main.go:58:2:58:15 | (...) |
6+
| main.go:61:3:61:16 | (...) |

0 commit comments

Comments
 (0)