Merge pull request #2864 from jbj/DefaultTaintTracking-cached

C++: Cache DefaultTaintTracking
This commit is contained in:
Mathias Vorreiter Pedersen
2020-02-25 10:15:43 +01:00
committed by GitHub

View File

@@ -343,6 +343,7 @@ private Element adjustedSink(DataFlow::Node sink) {
result.(AssignOperation).getAnOperand() = sink.asExpr()
}
cached
predicate tainted(Expr source, Element tainted) {
exists(DefaultTaintTrackingCfg cfg, DataFlow::Node sink |
cfg.hasFlow(getNodeForSource(source), sink) and
@@ -350,6 +351,7 @@ predicate tainted(Expr source, Element tainted) {
)
}
cached
predicate taintedIncludingGlobalVars(Expr source, Element tainted, string globalVar) {
tainted(source, tainted) and
globalVar = ""