mirror of
https://github.com/github/codeql.git
synced 2026-03-01 21:34:50 +01:00
- add flowsummaries shared files - register in indentical files - fix initial non-monotonic recursions - add DataFlowSourceCall - add resolvedCall - add SourceParameterNode failing tests: - 3/library-tests/with/test.ql
25 lines
788 B
Plaintext
25 lines
788 B
Plaintext
import semmle.python.dataflow.new.DataFlow
|
|
private import semmle.python.dataflow.new.internal.DataFlowPrivate as DataFlowPrivate
|
|
|
|
/**
|
|
* A configuration to find all "maximal" flows.
|
|
* To be used on small programs.
|
|
*/
|
|
class MaximalFlowsConfig extends DataFlow::Configuration {
|
|
MaximalFlowsConfig() { this = "AllFlowsConfig" }
|
|
|
|
override predicate isSource(DataFlow::Node node) {
|
|
node instanceof DataFlow::SourceParameterNode
|
|
or
|
|
node instanceof DataFlow::EssaNode and
|
|
not exists(DataFlow::EssaNode pred | DataFlow::localFlowStep(pred, node))
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node node) {
|
|
node instanceof DataFlowPrivate::ReturnNode
|
|
or
|
|
node instanceof DataFlow::EssaNode and
|
|
not exists(node.(DataFlow::EssaNode).getVar().getASourceUse())
|
|
}
|
|
}
|