File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
go/ql/src/InconsistentCode Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -124,20 +124,20 @@ class UnhandledFileCloseDataFlowConfiguration extends DataFlow::Configuration {
124
124
}
125
125
126
126
/**
127
- * Holds if a `DataFlow::CallNode ` is preceded by a call to `os.File.Sync`.
127
+ * Holds if a `node ` is preceded by a call to `os.File.Sync`.
128
128
*/
129
- predicate precededBySync ( DataFlow:: Node close , DataFlow:: CallNode closeCall ) {
129
+ predicate precededBySync ( DataFlow:: Node node , DataFlow:: CallNode call ) {
130
130
// using the control flow graph, try to find a call to a handled call to `os.File.Sync`
131
131
// which precedes `closeCall`.
132
132
exists ( IR:: Instruction instr , DataFlow:: Node syncReceiver , DataFlow:: CallNode syncCall |
133
133
// find a predecessor to `closeCall` in the control flow graph
134
- instr = closeCall .asInstruction ( ) .getAPredecessor * ( ) and
134
+ instr = call .asInstruction ( ) .getAPredecessor * ( ) and
135
135
// match the instruction corresponding to an `os.File.Sync` call with the predecessor
136
136
syncCall .asInstruction ( ) = instr and
137
137
// check that the call to `os.File.Sync` is handled
138
138
isHandledSync ( syncReceiver , syncCall ) and
139
139
// check that `os.File.Sync` is called on the same object as `os.File.Close`
140
- exists ( DataFlow:: SsaNode ssa | ssa .getAUse ( ) = close and ssa .getAUse ( ) = syncReceiver )
140
+ exists ( DataFlow:: SsaNode ssa | ssa .getAUse ( ) = node and ssa .getAUse ( ) = syncReceiver )
141
141
)
142
142
}
143
143
You can’t perform that action at this time.
0 commit comments