Skip to content

Commit d7c97f8

Browse files
authored
Merge pull request github#13455 from owen-mc/dataflow/add-flowCheckNodeSpecific
Dataflow: add language-specific hook for breaking up big step relation
2 parents 2187e56 + 3ff6d03 commit d7c97f8

File tree

16 files changed

+71
-13
lines changed

16 files changed

+71
-13
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ module Impl<FullStateConfigSig Config> {
20212021
FlowCheckNode() {
20222022
castNode(this.asNode()) or
20232023
clearsContentCached(this.asNode(), _) or
2024-
expectsContentCached(this.asNode(), _)
2024+
expectsContentCached(this.asNode(), _) or
2025+
neverSkipInPathGraph(this.asNode())
20252026
}
20262027
}
20272028

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ class CastNode extends Node {
235235
CastNode() { none() } // stub implementation
236236
}
237237

238+
/**
239+
* Holds if `n` should never be skipped over in the `PathGraph` and in path
240+
* explanations.
241+
*/
242+
predicate neverSkipInPathGraph(Node n) { none() }
243+
238244
class DataFlowCallable = Function;
239245

240246
class DataFlowExpr = Expr;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ module Impl<FullStateConfigSig Config> {
20212021
FlowCheckNode() {
20222022
castNode(this.asNode()) or
20232023
clearsContentCached(this.asNode(), _) or
2024-
expectsContentCached(this.asNode(), _)
2024+
expectsContentCached(this.asNode(), _) or
2025+
neverSkipInPathGraph(this.asNode())
20252026
}
20262027
}
20272028

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,12 @@ class CastNode extends Node {
783783
CastNode() { none() } // stub implementation
784784
}
785785

786+
/**
787+
* Holds if `n` should never be skipped over in the `PathGraph` and in path
788+
* explanations.
789+
*/
790+
predicate neverSkipInPathGraph(Node n) { none() }
791+
786792
/**
787793
* A function that may contain code or a variable that may contain itself. When
788794
* flow crosses from one _enclosing callable_ to another, the interprocedural

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ module Impl<FullStateConfigSig Config> {
20212021
FlowCheckNode() {
20222022
castNode(this.asNode()) or
20232023
clearsContentCached(this.asNode(), _) or
2024-
expectsContentCached(this.asNode(), _)
2024+
expectsContentCached(this.asNode(), _) or
2025+
neverSkipInPathGraph(this.asNode())
20252026
}
20262027
}
20272028

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,12 @@ class CastNode extends Node {
21402140
}
21412141
}
21422142

2143+
/**
2144+
* Holds if `n` should never be skipped over in the `PathGraph` and in path
2145+
* explanations.
2146+
*/
2147+
predicate neverSkipInPathGraph(Node n) { none() }
2148+
21432149
class DataFlowExpr = DotNet::Expr;
21442150

21452151
/** Holds if `e` is an expression that always has the same Boolean value `val`. */

go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ module Impl<FullStateConfigSig Config> {
20212021
FlowCheckNode() {
20222022
castNode(this.asNode()) or
20232023
clearsContentCached(this.asNode(), _) or
2024-
expectsContentCached(this.asNode(), _)
2024+
expectsContentCached(this.asNode(), _) or
2025+
neverSkipInPathGraph(this.asNode())
20252026
}
20262027
}
20272028

go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ class CastNode extends ExprNode {
228228
override ConversionExpr expr;
229229
}
230230

231+
/**
232+
* Holds if `n` should never be skipped over in the `PathGraph` and in path
233+
* explanations.
234+
*/
235+
predicate neverSkipInPathGraph(Node n) { none() }
236+
231237
class DataFlowExpr = Expr;
232238

233239
private newtype TDataFlowType =

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ module Impl<FullStateConfigSig Config> {
20212021
FlowCheckNode() {
20222022
castNode(this.asNode()) or
20232023
clearsContentCached(this.asNode(), _) or
2024-
expectsContentCached(this.asNode(), _)
2024+
expectsContentCached(this.asNode(), _) or
2025+
neverSkipInPathGraph(this.asNode())
20252026
}
20262027
}
20272028

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@ class CastNode extends ExprNode {
242242
CastNode() { this.getExpr() instanceof CastingExpr }
243243
}
244244

245+
/**
246+
* Holds if `n` should never be skipped over in the `PathGraph` and in path
247+
* explanations.
248+
*/
249+
predicate neverSkipInPathGraph(Node n) { none() }
250+
245251
private newtype TDataFlowCallable =
246252
TSrcCallable(Callable c) or
247253
TSummarizedCallable(SummarizedCallable c) or

0 commit comments

Comments
 (0)