Skip to content

Commit 541737d

Browse files
authored
Merge pull request github#13694 from egregius313/egregius313/add-default-isBarrier-2-isAdditionalFlowStep-4
DataFlow: Add default implementations of isBarrier/2 and isAddiitonalFlowStep/4
2 parents 8a573cc + 6329968 commit 541737d

File tree

15 files changed

+74
-16
lines changed

15 files changed

+74
-16
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: feature
3+
---
4+
* The `DataFlow::StateConfigSig` signature module has gained default implementations for `isBarrier/2` and `isAdditionalFlowStep/4`.
5+
Hence it is no longer needed to provide `none()` implementations of these predicates if they are not needed.
6+

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ signature module StateConfigSig {
114114
* Holds if data flow through `node` is prohibited when the flow state is
115115
* `state`.
116116
*/
117-
predicate isBarrier(Node node, FlowState state);
117+
default predicate isBarrier(Node node, FlowState state) { none() }
118118

119119
/** Holds if data flow into `node` is prohibited. */
120120
default predicate isBarrierIn(Node node) { none() }
@@ -131,7 +131,9 @@ signature module StateConfigSig {
131131
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
132132
* This step is only applicable in `state1` and updates the flow state to `state2`.
133133
*/
134-
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2);
134+
default predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
135+
none()
136+
}
135137

136138
/**
137139
* Holds if an arbitrary number of implicit read steps of content `c` may be

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ signature module StateConfigSig {
114114
* Holds if data flow through `node` is prohibited when the flow state is
115115
* `state`.
116116
*/
117-
predicate isBarrier(Node node, FlowState state);
117+
default predicate isBarrier(Node node, FlowState state) { none() }
118118

119119
/** Holds if data flow into `node` is prohibited. */
120120
default predicate isBarrierIn(Node node) { none() }
@@ -131,7 +131,9 @@ signature module StateConfigSig {
131131
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
132132
* This step is only applicable in `state1` and updates the flow state to `state2`.
133133
*/
134-
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2);
134+
default predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
135+
none()
136+
}
135137

136138
/**
137139
* Holds if an arbitrary number of implicit read steps of content `c` may be
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: feature
3+
---
4+
* The `DataFlow::StateConfigSig` signature module has gained default implementations for `isBarrier/2` and `isAdditionalFlowStep/4`.
5+
Hence it is no longer needed to provide `none()` implementations of these predicates if they are not needed.
6+

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ signature module StateConfigSig {
114114
* Holds if data flow through `node` is prohibited when the flow state is
115115
* `state`.
116116
*/
117-
predicate isBarrier(Node node, FlowState state);
117+
default predicate isBarrier(Node node, FlowState state) { none() }
118118

119119
/** Holds if data flow into `node` is prohibited. */
120120
default predicate isBarrierIn(Node node) { none() }
@@ -131,7 +131,9 @@ signature module StateConfigSig {
131131
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
132132
* This step is only applicable in `state1` and updates the flow state to `state2`.
133133
*/
134-
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2);
134+
default predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
135+
none()
136+
}
135137

136138
/**
137139
* Holds if an arbitrary number of implicit read steps of content `c` may be
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: feature
3+
---
4+
* The `DataFlow::StateConfigSig` signature module has gained default implementations for `isBarrier/2` and `isAdditionalFlowStep/4`.
5+
Hence it is no longer needed to provide `none()` implementations of these predicates if they are not needed.
6+

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ signature module StateConfigSig {
114114
* Holds if data flow through `node` is prohibited when the flow state is
115115
* `state`.
116116
*/
117-
predicate isBarrier(Node node, FlowState state);
117+
default predicate isBarrier(Node node, FlowState state) { none() }
118118

119119
/** Holds if data flow into `node` is prohibited. */
120120
default predicate isBarrierIn(Node node) { none() }
@@ -131,7 +131,9 @@ signature module StateConfigSig {
131131
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
132132
* This step is only applicable in `state1` and updates the flow state to `state2`.
133133
*/
134-
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2);
134+
default predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
135+
none()
136+
}
135137

136138
/**
137139
* Holds if an arbitrary number of implicit read steps of content `c` may be
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: feature
3+
---
4+
* The `DataFlow::StateConfigSig` signature module has gained default implementations for `isBarrier/2` and `isAdditionalFlowStep/4`.
5+
Hence it is no longer needed to provide `none()` implementations of these predicates if they are not needed.
6+

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ signature module StateConfigSig {
114114
* Holds if data flow through `node` is prohibited when the flow state is
115115
* `state`.
116116
*/
117-
predicate isBarrier(Node node, FlowState state);
117+
default predicate isBarrier(Node node, FlowState state) { none() }
118118

119119
/** Holds if data flow into `node` is prohibited. */
120120
default predicate isBarrierIn(Node node) { none() }
@@ -131,7 +131,9 @@ signature module StateConfigSig {
131131
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
132132
* This step is only applicable in `state1` and updates the flow state to `state2`.
133133
*/
134-
predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2);
134+
default predicate isAdditionalFlowStep(Node node1, FlowState state1, Node node2, FlowState state2) {
135+
none()
136+
}
135137

136138
/**
137139
* Holds if an arbitrary number of implicit read steps of content `c` may be
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: feature
3+
---
4+
* The `DataFlow::StateConfigSig` signature module has gained default implementations for `isBarrier/2` and `isAdditionalFlowStep/4`.
5+
Hence it is no longer needed to provide `none()` implementations of these predicates if they are not needed.
6+

0 commit comments

Comments
 (0)