mirror of
https://github.com/github/codeql.git
synced 2026-03-21 15:06:46 +01:00
27 lines
704 B
Plaintext
27 lines
704 B
Plaintext
import experimental.dataflow.DataFlow
|
|
|
|
/**
|
|
* 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::ParameterNode
|
|
or
|
|
node = DataFlow::TEssaNode(_) and
|
|
not exists(DataFlow::Node pred |
|
|
pred = DataFlow::TEssaNode(_) and
|
|
DataFlow::localFlowStep(pred, node)
|
|
)
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node node) {
|
|
node instanceof DataFlow::ReturnNode
|
|
or
|
|
node = DataFlow::TEssaNode(_) and
|
|
not exists(node.asEssaNode().getASourceUse())
|
|
}
|
|
}
|