mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
26 lines
681 B
Plaintext
26 lines
681 B
Plaintext
import python
|
|
import Resources.FileNotAlwaysClosedQuery
|
|
import utils.test.InlineExpectationsTest
|
|
|
|
module MethodArgTest implements TestSig {
|
|
string getARelevantTag() { result = ["notClosed", "notClosedOnException"] }
|
|
|
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
exists(DataFlow::CfgNode el, FileOpen fo |
|
|
el = fo and
|
|
element = el.toString() and
|
|
location = el.getLocation() and
|
|
value = "" and
|
|
(
|
|
fileNotClosed(fo) and
|
|
tag = "notClosed"
|
|
or
|
|
fileMayNotBeClosedOnException(fo, _) and
|
|
tag = "notClosedOnException"
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
import MakeTest<MethodArgTest>
|