Skip to content

Commit e05bce9

Browse files
committed
Update expected test results
1 parent 314ecab commit e05bce9

File tree

2 files changed

+67
-8
lines changed

2 files changed

+67
-8
lines changed
Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,66 @@
1-
| tests.go:22:8:22:8 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
2-
| tests.go:22:8:22:8 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
3-
| tests.go:27:3:27:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
4-
| tests.go:27:3:27:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
5-
| tests.go:53:3:53:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
6-
| tests.go:63:3:63:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
7-
| tests.go:119:3:119:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
1+
edges
2+
| tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:10:9:10:9 | f : pointer type |
3+
| tests.go:10:9:10:9 | f : pointer type | tests.go:34:5:34:38 | ... := ...[0] : pointer type |
4+
| tests.go:10:9:10:9 | f : pointer type | tests.go:51:5:51:38 | ... := ...[0] : pointer type |
5+
| tests.go:10:9:10:9 | f : pointer type | tests.go:77:5:77:38 | ... := ...[0] : pointer type |
6+
| tests.go:10:9:10:9 | f : pointer type | tests.go:87:5:87:38 | ... := ...[0] : pointer type |
7+
| tests.go:10:9:10:9 | f : pointer type | tests.go:99:5:99:38 | ... := ...[0] : pointer type |
8+
| tests.go:10:9:10:9 | f : pointer type | tests.go:115:5:115:38 | ... := ...[0] : pointer type |
9+
| tests.go:18:2:18:69 | return statement[0] : pointer type | tests.go:44:5:44:42 | ... := ...[0] : pointer type |
10+
| tests.go:18:2:18:69 | return statement[0] : pointer type | tests.go:61:5:61:42 | ... := ...[0] : pointer type |
11+
| tests.go:21:24:21:24 | definition of f : pointer type | tests.go:22:8:22:8 | f |
12+
| tests.go:25:32:25:32 | definition of f : pointer type | tests.go:26:13:26:13 | capture variable f : pointer type |
13+
| tests.go:26:13:26:13 | capture variable f : pointer type | tests.go:27:3:27:3 | f |
14+
| tests.go:34:5:34:38 | ... := ...[0] : pointer type | tests.go:35:21:35:21 | f : pointer type |
15+
| tests.go:34:5:34:38 | ... := ...[0] : pointer type | tests.go:36:29:36:29 | f : pointer type |
16+
| tests.go:35:21:35:21 | f : pointer type | tests.go:21:24:21:24 | definition of f : pointer type |
17+
| tests.go:36:29:36:29 | f : pointer type | tests.go:25:32:25:32 | definition of f : pointer type |
18+
| tests.go:44:5:44:42 | ... := ...[0] : pointer type | tests.go:45:21:45:21 | f : pointer type |
19+
| tests.go:44:5:44:42 | ... := ...[0] : pointer type | tests.go:46:29:46:29 | f : pointer type |
20+
| tests.go:45:21:45:21 | f : pointer type | tests.go:21:24:21:24 | definition of f : pointer type |
21+
| tests.go:46:29:46:29 | f : pointer type | tests.go:25:32:25:32 | definition of f : pointer type |
22+
| tests.go:51:5:51:38 | ... := ...[0] : pointer type | tests.go:53:3:53:3 | f |
23+
| tests.go:61:5:61:42 | ... := ...[0] : pointer type | tests.go:63:3:63:3 | f |
24+
| tests.go:77:5:77:38 | ... := ...[0] : pointer type | tests.go:80:4:80:4 | f |
25+
| tests.go:77:5:77:38 | ... := ...[0] : pointer type | tests.go:82:3:82:3 | f |
26+
| tests.go:87:5:87:38 | ... := ...[0] : pointer type | tests.go:90:9:90:9 | f |
27+
| tests.go:99:5:99:38 | ... := ...[0] : pointer type | tests.go:101:9:101:9 | f |
28+
| tests.go:115:5:115:38 | ... := ...[0] : pointer type | tests.go:119:3:119:3 | f |
29+
nodes
30+
| tests.go:9:2:9:74 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
31+
| tests.go:10:9:10:9 | f : pointer type | semmle.label | f : pointer type |
32+
| tests.go:18:2:18:69 | return statement[0] : pointer type | semmle.label | return statement[0] : pointer type |
33+
| tests.go:21:24:21:24 | definition of f : pointer type | semmle.label | definition of f : pointer type |
34+
| tests.go:22:8:22:8 | f | semmle.label | f |
35+
| tests.go:25:32:25:32 | definition of f : pointer type | semmle.label | definition of f : pointer type |
36+
| tests.go:26:13:26:13 | capture variable f : pointer type | semmle.label | capture variable f : pointer type |
37+
| tests.go:27:3:27:3 | f | semmle.label | f |
38+
| tests.go:34:5:34:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
39+
| tests.go:35:21:35:21 | f : pointer type | semmle.label | f : pointer type |
40+
| tests.go:36:29:36:29 | f : pointer type | semmle.label | f : pointer type |
41+
| tests.go:44:5:44:42 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
42+
| tests.go:45:21:45:21 | f : pointer type | semmle.label | f : pointer type |
43+
| tests.go:46:29:46:29 | f : pointer type | semmle.label | f : pointer type |
44+
| tests.go:51:5:51:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
45+
| tests.go:53:3:53:3 | f | semmle.label | f |
46+
| tests.go:61:5:61:42 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
47+
| tests.go:63:3:63:3 | f | semmle.label | f |
48+
| tests.go:77:5:77:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
49+
| tests.go:80:4:80:4 | f | semmle.label | f |
50+
| tests.go:82:3:82:3 | f | semmle.label | f |
51+
| tests.go:87:5:87:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
52+
| tests.go:90:9:90:9 | f | semmle.label | f |
53+
| tests.go:99:5:99:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
54+
| tests.go:101:9:101:9 | f | semmle.label | f |
55+
| tests.go:115:5:115:38 | ... := ...[0] : pointer type | semmle.label | ... := ...[0] : pointer type |
56+
| tests.go:119:3:119:3 | f | semmle.label | f |
57+
subpaths
58+
#select
59+
| tests.go:22:8:22:8 | f | tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:22:8:22:8 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
60+
| tests.go:22:8:22:8 | f | tests.go:18:2:18:69 | return statement[0] : pointer type | tests.go:22:8:22:8 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
61+
| tests.go:27:3:27:3 | f | tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:27:3:27:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
62+
| tests.go:27:3:27:3 | f | tests.go:18:2:18:69 | return statement[0] : pointer type | tests.go:27:3:27:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
63+
| tests.go:53:3:53:3 | f | tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:53:3:53:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
64+
| tests.go:63:3:63:3 | f | tests.go:18:2:18:69 | return statement[0] : pointer type | tests.go:63:3:63:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:18:9:18:69 | call to OpenFile | call to OpenFile |
65+
| tests.go:101:9:101:9 | f | tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:101:9:101:9 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |
66+
| tests.go:119:3:119:3 | f | tests.go:9:2:9:74 | ... := ...[0] : pointer type | tests.go:119:3:119:3 | f | File handle may be writable as a result of data flow from a $@ and closing it may result in data loss upon failure, which is not handled explicitly. | tests.go:9:12:9:74 | call to OpenFile | call to OpenFile |

go/ql/test/query-tests/InconsistentCode/UnhandledCloseWritableHandle/tests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func deferredCloseWithSync() {
9898
func deferredCloseWithSyncEarlyReturn(n int) {
9999
if f, err := openFileWrite("foo.txt"); err != nil {
100100
// a call to `Close` is deferred
101-
defer f.Close() // NOT OK - false negative
101+
defer f.Close() // NOT OK
102102

103103
if n > 100 {
104104
return

0 commit comments

Comments
 (0)