mirror of
https://github.com/github/codeql.git
synced 2025-12-28 06:36:33 +01:00
Also needed to fix up `TestUtil/UnresolvedCalls.qll` after a bad merge conflict resolution. Since all calls are now DataFlowCall, and not JUST the ones that can be resolved, we need to put in the restriction that the callable can also be resolved.
27 lines
1.0 KiB
Plaintext
27 lines
1.0 KiB
Plaintext
import python
|
|
private import semmle.python.dataflow.new.internal.PrintNode
|
|
private import semmle.python.dataflow.new.internal.DataFlowPrivate as DataFlowPrivate
|
|
private import semmle.python.ApiGraphs
|
|
import TestUtilities.InlineExpectationsTest
|
|
|
|
class UnresolvedCallExpectations extends InlineExpectationsTest {
|
|
UnresolvedCallExpectations() { this = "UnresolvedCallExpectations" }
|
|
|
|
override string getARelevantTag() { result = "unresolved_call" }
|
|
|
|
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
exists(location.getFile().getRelativePath()) and
|
|
exists(CallNode call |
|
|
not exists(DataFlowPrivate::DataFlowCall dfc |
|
|
exists(dfc.getCallable()) and dfc.getNode() = call
|
|
) and
|
|
not DataFlowPrivate::resolveClassCall(call, _) and
|
|
not call = API::builtin(_).getACall().asCfgNode() and
|
|
location = call.getLocation() and
|
|
tag = "unresolved_call" and
|
|
value = prettyExpr(call.getNode()) and
|
|
element = call.toString()
|
|
)
|
|
}
|
|
}
|