Skip to content

Commit 36865e3

Browse files
committed
Add test showing bug
1 parent 9269141 commit 36865e3

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎go/ql/test/query-tests/RedundantCode/UnreachableStatement/CONSISTENCY/CfgConsistency.expected‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
consistencyOverview
2-
| deadEnd | 9 |
2+
| deadEnd | 10 |
33
deadEnd
44
| main.go:17:2:17:10 | select statement |
55
| main.go:109:2:109:10 | select statement |
@@ -10,3 +10,4 @@ deadEnd
1010
| main.go:145:2:145:10 | select statement |
1111
| main.go:151:2:151:10 | select statement |
1212
| main.go:157:2:157:10 | select statement |
13+
| main.go:163:2:163:10 | select statement |

‎go/ql/test/query-tests/RedundantCode/UnreachableStatement/main.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,10 @@ func test19() mystruct {
159159
return mystruct{test10(1), test10(2) == 2} // $ Alert
160160
}
161161

162+
func test20() {
163+
select {}
164+
panic("unreachable") // OK: allowlisted statement
165+
unreachable() // $ MISSING: Alert
166+
}
167+
162168
func main() {}

0 commit comments

Comments
 (0)