Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28304e4

Browse files
authored
Merge pull request #1005 from jbj/dataflow-Node-cached
C++: Cache TNode and localFlowStep
2 parents f91e06b + 264301b commit 28304e4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowUtil.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import cpp
55
private import semmle.code.cpp.dataflow.internal.FlowVar
66

7+
cached
78
private newtype TNode =
89
TExprNode(Expr e) or
910
TParameterNode(Parameter p) { exists(p.getFunction().getBlock()) } or
@@ -161,6 +162,7 @@ private Variable asVariable(Node node) {
161162
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
162163
* (intra-procedural) step.
163164
*/
165+
cached
164166
predicate localFlowStep(Node nodeFrom, Node nodeTo) {
165167
// Expr -> Expr
166168
exprToExprStep_nocfg(nodeFrom.asExpr(), nodeTo.asExpr())

0 commit comments

Comments
 (0)