C++: Cache DefaultTaintTracking

This should speed up the overall suite, where `DefaultTaintTracking` is
used in several queries.
This commit is contained in:
Jonas Jensen
2020-02-18 15:49:31 +01:00
committed by Jonas Jensen
parent 94aa77748d
commit ae68878476

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 = ""