1616import go
1717
1818/**
19- * Holds if a flag for use with `os.OpenFile` implies that the resulting
19+ * Holds if a ` flag` for use with `os.OpenFile` implies that the resulting
2020 * file handle will be writable.
2121 */
2222predicate isWritable ( Entity flag ) {
@@ -25,7 +25,7 @@ predicate isWritable(Entity flag) {
2525}
2626
2727/**
28- * Gets constant names from an expression .
28+ * Gets constant names from `expr` .
2929 */
3030QualifiedName getConstants ( ValueExpr expr ) {
3131 result = expr or
@@ -54,7 +54,7 @@ class SyncFileFun extends Method {
5454}
5555
5656/**
57- * Determines whether a call to a function is "unhandled". That is, it is either
57+ * Holds if a ` call` to a function is "unhandled". That is, it is either
5858 * deferred or its result is not assigned to anything.
5959 *
6060 * TODO: maybe we should check that something is actually done with the result
@@ -65,7 +65,7 @@ predicate unhandledCall(DataFlow::CallNode call) {
6565}
6666
6767/**
68- * Determines whether `source` is a writable file handle returned by a `call` to the
68+ * Holds if `source` is a writable file handle returned by a `call` to the
6969 * `os.OpenFile` function.
7070 */
7171predicate isWritableFileHandle ( DataFlow:: Node source , DataFlow:: CallNode call ) {
@@ -87,7 +87,7 @@ predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
8787}
8888
8989/**
90- * Determines whether `os.File.Close` is called on `sink`.
90+ * Holds if `os.File.Close` is called on `sink`.
9191 */
9292predicate isCloseSink ( DataFlow:: Node sink , DataFlow:: CallNode call ) {
9393 // find calls to the os.File.Close function
@@ -99,7 +99,7 @@ predicate isCloseSink(DataFlow::Node sink, DataFlow::CallNode call) {
9999}
100100
101101/**
102- * Determines whether `os.File.Sync` is called on `sink` and the result of the call is neither
102+ * Holds if `os.File.Sync` is called on `sink` and the result of the call is neither
103103 * deferred nor discarded.
104104 */
105105predicate isHandledSync ( DataFlow:: Node sink , DataFlow:: CallNode syncCall ) {
@@ -124,7 +124,7 @@ class UnhandledFileCloseDataFlowConfiguration extends DataFlow::Configuration {
124124}
125125
126126/**
127- * Determines whether a `DataFlow::CallNode` is preceded by a call to `os.File.Sync`.
127+ * Holds if a `DataFlow::CallNode` is preceded by a call to `os.File.Sync`.
128128 */
129129predicate precededBySync ( DataFlow:: Node close , DataFlow:: CallNode closeCall ) {
130130 // using the control flow graph, try to find a call to a handled call to `os.File.Sync`
0 commit comments