Skip to content

Commit 95d1704

Browse files
committed
Dataflow: Sync.
1 parent fd83b6a commit 95d1704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+251
-7
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ signature module ConfigSig {
4646
*/
4747
default predicate allowImplicitRead(Node node, ContentSet c) { none() }
4848

49+
/**
50+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
51+
* explanations.
52+
*/
53+
default predicate neverSkip(Node node) {
54+
isAdditionalFlowStep(node, _) or isAdditionalFlowStep(_, node)
55+
}
56+
4957
/**
5058
* Gets the virtual dispatch branching limit when calculating field flow.
5159
* This can be overridden to a smaller value to improve performance (a
@@ -141,6 +149,17 @@ signature module StateConfigSig {
141149
*/
142150
default predicate allowImplicitRead(Node node, ContentSet c) { none() }
143151

152+
/**
153+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
154+
* explanations.
155+
*/
156+
default predicate neverSkip(Node node) {
157+
isAdditionalFlowStep(node, _) or
158+
isAdditionalFlowStep(_, node) or
159+
isAdditionalFlowStep(node, _, _, _) or
160+
isAdditionalFlowStep(_, _, node, _)
161+
}
162+
144163
/**
145164
* Gets the virtual dispatch branching limit when calculating field flow.
146165
* This can be overridden to a smaller value to improve performance (a

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ signature module FullStateConfigSig {
6666
*/
6767
predicate allowImplicitRead(Node node, ContentSet c);
6868

69+
/**
70+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
71+
* explanations.
72+
*/
73+
predicate neverSkip(Node node);
74+
6975
/**
7076
* Gets the virtual dispatch branching limit when calculating field flow.
7177
* This can be overridden to a smaller value to improve performance (a
@@ -2024,7 +2030,8 @@ module Impl<FullStateConfigSig Config> {
20242030
castNode(this.asNode()) or
20252031
clearsContentCached(this.asNode(), _) or
20262032
expectsContentCached(this.asNode(), _) or
2027-
neverSkipInPathGraph(this.asNode())
2033+
neverSkipInPathGraph(this.asNode()) or
2034+
Config::neverSkip(this.asNode())
20282035
}
20292036
}
20302037

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ signature module ConfigSig {
4646
*/
4747
default predicate allowImplicitRead(Node node, ContentSet c) { none() }
4848

49+
/**
50+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
51+
* explanations.
52+
*/
53+
default predicate neverSkip(Node node) {
54+
isAdditionalFlowStep(node, _) or isAdditionalFlowStep(_, node)
55+
}
56+
4957
/**
5058
* Gets the virtual dispatch branching limit when calculating field flow.
5159
* This can be overridden to a smaller value to improve performance (a
@@ -141,6 +149,17 @@ signature module StateConfigSig {
141149
*/
142150
default predicate allowImplicitRead(Node node, ContentSet c) { none() }
143151

152+
/**
153+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
154+
* explanations.
155+
*/
156+
default predicate neverSkip(Node node) {
157+
isAdditionalFlowStep(node, _) or
158+
isAdditionalFlowStep(_, node) or
159+
isAdditionalFlowStep(node, _, _, _) or
160+
isAdditionalFlowStep(_, _, node, _)
161+
}
162+
144163
/**
145164
* Gets the virtual dispatch branching limit when calculating field flow.
146165
* This can be overridden to a smaller value to improve performance (a

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ signature module FullStateConfigSig {
6666
*/
6767
predicate allowImplicitRead(Node node, ContentSet c);
6868

69+
/**
70+
* Holds if `node` should never be skipped over in the `PathGraph` and in path
71+
* explanations.
72+
*/
73+
predicate neverSkip(Node node);
74+
6975
/**
7076
* Gets the virtual dispatch branching limit when calculating field flow.
7177
* This can be overridden to a smaller value to improve performance (a
@@ -2024,7 +2030,8 @@ module Impl<FullStateConfigSig Config> {
20242030
castNode(this.asNode()) or
20252031
clearsContentCached(this.asNode(), _) or
20262032
expectsContentCached(this.asNode(), _) or
2027-
neverSkipInPathGraph(this.asNode())
2033+
neverSkipInPathGraph(this.asNode()) or
2034+
Config::neverSkip(this.asNode())
20282035
}
20292036
}
20302037

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ private module Config implements FullStateConfigSig {
313313
any(Configuration config).allowImplicitRead(node, c)
314314
}
315315

316+
predicate neverSkip(Node node) { none() }
317+
316318
int fieldFlowBranchLimit() { result = min(any(Configuration config).fieldFlowBranchLimit()) }
317319

318320
FlowFeature getAFeature() { result = any(Configuration config).getAFeature() }

0 commit comments

Comments
 (0)