Skip to content

Commit 5217ede

Browse files
committed
Go: Tidy up comments in writable-file-close query
Correct the doc for unhandledCall (it also matches expression statements where the result is discarded) and remove a stale commented-out line in isWritableFileHandle.
1 parent 5990812 commit 5217ede

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class SyncFileFun extends Method {
5555

5656
/**
5757
* Holds if a `call` to a function is "unhandled". That is, it is either
58-
* deferred or its result is not assigned to anything.
58+
* deferred or used as an expression statement, so that its result is discarded.
5959
*
6060
* TODO: maybe we should check that something is actually done with the result
6161
*/
@@ -77,7 +77,6 @@ predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
7777
// get the flags expression used for opening the file
7878
call.getArgument(1) = flags and
7979
// extract individual flags from the argument
80-
// flag = flag.getAChild*() and
8180
flag = getConstants(flags.asExpr()) and
8281
// check for one which signals that the handle will be writable
8382
// note that we are underestimating here, since the flags may be

0 commit comments

Comments
 (0)