Skip to content

Commit 60fe370

Browse files
authored
Merge pull request github#10744 from hvitved/dataflow/has-flow-to-no-fast-tc
Data flow: Avoid call to `pathSuccPlus` in `Configuration::hasFlowTo(Expr)`
2 parents 099251a + 296ec94 commit 60fe370

37 files changed

+111
-37
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ abstract class Configuration extends string {
163163
/**
164164
* Holds if data may flow from some source to `sink` for this configuration.
165165
*/
166-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
166+
predicate hasFlowTo(Node sink) {
167+
sink = any(PathNodeSink n | this = n.getConfiguration()).getNodeEx().asNode()
168+
}
167169

168170
/**
169171
* Holds if data may flow from some source to `sink` for this configuration.

0 commit comments

Comments
 (0)