16
16
import go
17
17
18
18
/**
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
20
20
* file handle will be writable.
21
21
*/
22
22
predicate isWritable ( Entity flag ) {
@@ -25,7 +25,7 @@ predicate isWritable(Entity flag) {
25
25
}
26
26
27
27
/**
28
- * Gets constant names from an expression .
28
+ * Gets constant names from `expr` .
29
29
*/
30
30
QualifiedName getConstants ( ValueExpr expr ) {
31
31
result = expr or
@@ -54,7 +54,7 @@ class SyncFileFun extends Method {
54
54
}
55
55
56
56
/**
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
58
58
* deferred or its result is not assigned to anything.
59
59
*
60
60
* TODO: maybe we should check that something is actually done with the result
@@ -65,7 +65,7 @@ predicate unhandledCall(DataFlow::CallNode call) {
65
65
}
66
66
67
67
/**
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
69
69
* `os.OpenFile` function.
70
70
*/
71
71
predicate isWritableFileHandle ( DataFlow:: Node source , DataFlow:: CallNode call ) {
@@ -87,7 +87,7 @@ predicate isWritableFileHandle(DataFlow::Node source, DataFlow::CallNode call) {
87
87
}
88
88
89
89
/**
90
- * Determines whether `os.File.Close` is called on `sink`.
90
+ * Holds if `os.File.Close` is called on `sink`.
91
91
*/
92
92
predicate isCloseSink ( DataFlow:: Node sink , DataFlow:: CallNode call ) {
93
93
// find calls to the os.File.Close function
@@ -99,7 +99,7 @@ predicate isCloseSink(DataFlow::Node sink, DataFlow::CallNode call) {
99
99
}
100
100
101
101
/**
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
103
103
* deferred nor discarded.
104
104
*/
105
105
predicate isHandledSync ( DataFlow:: Node sink , DataFlow:: CallNode syncCall ) {
@@ -124,7 +124,7 @@ class UnhandledFileCloseDataFlowConfiguration extends DataFlow::Configuration {
124
124
}
125
125
126
126
/**
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`.
128
128
*/
129
129
predicate precededBySync ( DataFlow:: Node close , DataFlow:: CallNode closeCall ) {
130
130
// using the control flow graph, try to find a call to a handled call to `os.File.Sync`
0 commit comments