Skip to content

Commit 4bc4e08

Browse files
committed
delete the deprecated isBarrierGuard predicate from the shared dataflow library, and its uses
1 parent eb3f196 commit 4bc4e08

File tree

138 files changed

+29
-2660
lines changed

Some content is hidden

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

138 files changed

+29
-2660
lines changed

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

+1-41
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ abstract class Configuration extends string {
9191
/** Holds if data flow out of `node` is prohibited. */
9292
predicate isBarrierOut(Node node) { none() }
9393

94-
/**
95-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
96-
*
97-
* Holds if data flow through nodes guarded by `guard` is prohibited.
98-
*/
99-
deprecated predicate isBarrierGuard(BarrierGuard guard) { none() }
100-
101-
/**
102-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
103-
*
104-
* Holds if data flow through nodes guarded by `guard` is prohibited when
105-
* the flow state is `state`
106-
*/
107-
deprecated predicate isBarrierGuard(BarrierGuard guard, FlowState state) { none() }
108-
10994
/**
11095
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
11196
*/
@@ -225,29 +210,6 @@ abstract private class ConfigurationRecursionPrevention extends Configuration {
225210
}
226211
}
227212

228-
/** A bridge class to access the deprecated `isBarrierGuard`. */
229-
private class BarrierGuardGuardedNodeBridge extends Unit {
230-
abstract predicate guardedNode(Node n, Configuration config);
231-
232-
abstract predicate guardedNode(Node n, FlowState state, Configuration config);
233-
}
234-
235-
private class BarrierGuardGuardedNode extends BarrierGuardGuardedNodeBridge {
236-
deprecated override predicate guardedNode(Node n, Configuration config) {
237-
exists(BarrierGuard g |
238-
config.isBarrierGuard(g) and
239-
n = g.getAGuardedNode()
240-
)
241-
}
242-
243-
deprecated override predicate guardedNode(Node n, FlowState state, Configuration config) {
244-
exists(BarrierGuard g |
245-
config.isBarrierGuard(g, state) and
246-
n = g.getAGuardedNode()
247-
)
248-
}
249-
}
250-
251213
private FlowState relevantState(Configuration config) {
252214
config.isSource(_, result) or
253215
config.isSink(_, result) or
@@ -288,9 +250,7 @@ private module Config implements FullStateConfigSig {
288250

289251
predicate isBarrier(Node node, FlowState state) {
290252
getConfig(state).isBarrier(node, getState(state)) or
291-
getConfig(state).isBarrier(node) or
292-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getState(state), getConfig(state)) or
293-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getConfig(state))
253+
getConfig(state).isBarrier(node)
294254
}
295255

296256
predicate isBarrierIn(Node node) { any(Configuration config).isBarrierIn(node) }

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

+1-41
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ abstract class Configuration extends string {
9191
/** Holds if data flow out of `node` is prohibited. */
9292
predicate isBarrierOut(Node node) { none() }
9393

94-
/**
95-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
96-
*
97-
* Holds if data flow through nodes guarded by `guard` is prohibited.
98-
*/
99-
deprecated predicate isBarrierGuard(BarrierGuard guard) { none() }
100-
101-
/**
102-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
103-
*
104-
* Holds if data flow through nodes guarded by `guard` is prohibited when
105-
* the flow state is `state`
106-
*/
107-
deprecated predicate isBarrierGuard(BarrierGuard guard, FlowState state) { none() }
108-
10994
/**
11095
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
11196
*/
@@ -225,29 +210,6 @@ abstract private class ConfigurationRecursionPrevention extends Configuration {
225210
}
226211
}
227212

228-
/** A bridge class to access the deprecated `isBarrierGuard`. */
229-
private class BarrierGuardGuardedNodeBridge extends Unit {
230-
abstract predicate guardedNode(Node n, Configuration config);
231-
232-
abstract predicate guardedNode(Node n, FlowState state, Configuration config);
233-
}
234-
235-
private class BarrierGuardGuardedNode extends BarrierGuardGuardedNodeBridge {
236-
deprecated override predicate guardedNode(Node n, Configuration config) {
237-
exists(BarrierGuard g |
238-
config.isBarrierGuard(g) and
239-
n = g.getAGuardedNode()
240-
)
241-
}
242-
243-
deprecated override predicate guardedNode(Node n, FlowState state, Configuration config) {
244-
exists(BarrierGuard g |
245-
config.isBarrierGuard(g, state) and
246-
n = g.getAGuardedNode()
247-
)
248-
}
249-
}
250-
251213
private FlowState relevantState(Configuration config) {
252214
config.isSource(_, result) or
253215
config.isSink(_, result) or
@@ -288,9 +250,7 @@ private module Config implements FullStateConfigSig {
288250

289251
predicate isBarrier(Node node, FlowState state) {
290252
getConfig(state).isBarrier(node, getState(state)) or
291-
getConfig(state).isBarrier(node) or
292-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getState(state), getConfig(state)) or
293-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getConfig(state))
253+
getConfig(state).isBarrier(node)
294254
}
295255

296256
predicate isBarrierIn(Node node) { any(Configuration config).isBarrierIn(node) }

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

+1-41
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ abstract class Configuration extends string {
9191
/** Holds if data flow out of `node` is prohibited. */
9292
predicate isBarrierOut(Node node) { none() }
9393

94-
/**
95-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
96-
*
97-
* Holds if data flow through nodes guarded by `guard` is prohibited.
98-
*/
99-
deprecated predicate isBarrierGuard(BarrierGuard guard) { none() }
100-
101-
/**
102-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
103-
*
104-
* Holds if data flow through nodes guarded by `guard` is prohibited when
105-
* the flow state is `state`
106-
*/
107-
deprecated predicate isBarrierGuard(BarrierGuard guard, FlowState state) { none() }
108-
10994
/**
11095
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
11196
*/
@@ -225,29 +210,6 @@ abstract private class ConfigurationRecursionPrevention extends Configuration {
225210
}
226211
}
227212

228-
/** A bridge class to access the deprecated `isBarrierGuard`. */
229-
private class BarrierGuardGuardedNodeBridge extends Unit {
230-
abstract predicate guardedNode(Node n, Configuration config);
231-
232-
abstract predicate guardedNode(Node n, FlowState state, Configuration config);
233-
}
234-
235-
private class BarrierGuardGuardedNode extends BarrierGuardGuardedNodeBridge {
236-
deprecated override predicate guardedNode(Node n, Configuration config) {
237-
exists(BarrierGuard g |
238-
config.isBarrierGuard(g) and
239-
n = g.getAGuardedNode()
240-
)
241-
}
242-
243-
deprecated override predicate guardedNode(Node n, FlowState state, Configuration config) {
244-
exists(BarrierGuard g |
245-
config.isBarrierGuard(g, state) and
246-
n = g.getAGuardedNode()
247-
)
248-
}
249-
}
250-
251213
private FlowState relevantState(Configuration config) {
252214
config.isSource(_, result) or
253215
config.isSink(_, result) or
@@ -288,9 +250,7 @@ private module Config implements FullStateConfigSig {
288250

289251
predicate isBarrier(Node node, FlowState state) {
290252
getConfig(state).isBarrier(node, getState(state)) or
291-
getConfig(state).isBarrier(node) or
292-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getState(state), getConfig(state)) or
293-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getConfig(state))
253+
getConfig(state).isBarrier(node)
294254
}
295255

296256
predicate isBarrierIn(Node node) { any(Configuration config).isBarrierIn(node) }

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

+1-41
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ abstract class Configuration extends string {
9191
/** Holds if data flow out of `node` is prohibited. */
9292
predicate isBarrierOut(Node node) { none() }
9393

94-
/**
95-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
96-
*
97-
* Holds if data flow through nodes guarded by `guard` is prohibited.
98-
*/
99-
deprecated predicate isBarrierGuard(BarrierGuard guard) { none() }
100-
101-
/**
102-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
103-
*
104-
* Holds if data flow through nodes guarded by `guard` is prohibited when
105-
* the flow state is `state`
106-
*/
107-
deprecated predicate isBarrierGuard(BarrierGuard guard, FlowState state) { none() }
108-
10994
/**
11095
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
11196
*/
@@ -225,29 +210,6 @@ abstract private class ConfigurationRecursionPrevention extends Configuration {
225210
}
226211
}
227212

228-
/** A bridge class to access the deprecated `isBarrierGuard`. */
229-
private class BarrierGuardGuardedNodeBridge extends Unit {
230-
abstract predicate guardedNode(Node n, Configuration config);
231-
232-
abstract predicate guardedNode(Node n, FlowState state, Configuration config);
233-
}
234-
235-
private class BarrierGuardGuardedNode extends BarrierGuardGuardedNodeBridge {
236-
deprecated override predicate guardedNode(Node n, Configuration config) {
237-
exists(BarrierGuard g |
238-
config.isBarrierGuard(g) and
239-
n = g.getAGuardedNode()
240-
)
241-
}
242-
243-
deprecated override predicate guardedNode(Node n, FlowState state, Configuration config) {
244-
exists(BarrierGuard g |
245-
config.isBarrierGuard(g, state) and
246-
n = g.getAGuardedNode()
247-
)
248-
}
249-
}
250-
251213
private FlowState relevantState(Configuration config) {
252214
config.isSource(_, result) or
253215
config.isSink(_, result) or
@@ -288,9 +250,7 @@ private module Config implements FullStateConfigSig {
288250

289251
predicate isBarrier(Node node, FlowState state) {
290252
getConfig(state).isBarrier(node, getState(state)) or
291-
getConfig(state).isBarrier(node) or
292-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getState(state), getConfig(state)) or
293-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getConfig(state))
253+
getConfig(state).isBarrier(node)
294254
}
295255

296256
predicate isBarrierIn(Node node) { any(Configuration config).isBarrierIn(node) }

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

+1-41
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ abstract class Configuration extends string {
9191
/** Holds if data flow out of `node` is prohibited. */
9292
predicate isBarrierOut(Node node) { none() }
9393

94-
/**
95-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
96-
*
97-
* Holds if data flow through nodes guarded by `guard` is prohibited.
98-
*/
99-
deprecated predicate isBarrierGuard(BarrierGuard guard) { none() }
100-
101-
/**
102-
* DEPRECATED: Use `isBarrier` and `BarrierGuard` module instead.
103-
*
104-
* Holds if data flow through nodes guarded by `guard` is prohibited when
105-
* the flow state is `state`
106-
*/
107-
deprecated predicate isBarrierGuard(BarrierGuard guard, FlowState state) { none() }
108-
10994
/**
11095
* Holds if data may flow from `node1` to `node2` in addition to the normal data-flow steps.
11196
*/
@@ -225,29 +210,6 @@ abstract private class ConfigurationRecursionPrevention extends Configuration {
225210
}
226211
}
227212

228-
/** A bridge class to access the deprecated `isBarrierGuard`. */
229-
private class BarrierGuardGuardedNodeBridge extends Unit {
230-
abstract predicate guardedNode(Node n, Configuration config);
231-
232-
abstract predicate guardedNode(Node n, FlowState state, Configuration config);
233-
}
234-
235-
private class BarrierGuardGuardedNode extends BarrierGuardGuardedNodeBridge {
236-
deprecated override predicate guardedNode(Node n, Configuration config) {
237-
exists(BarrierGuard g |
238-
config.isBarrierGuard(g) and
239-
n = g.getAGuardedNode()
240-
)
241-
}
242-
243-
deprecated override predicate guardedNode(Node n, FlowState state, Configuration config) {
244-
exists(BarrierGuard g |
245-
config.isBarrierGuard(g, state) and
246-
n = g.getAGuardedNode()
247-
)
248-
}
249-
}
250-
251213
private FlowState relevantState(Configuration config) {
252214
config.isSource(_, result) or
253215
config.isSink(_, result) or
@@ -288,9 +250,7 @@ private module Config implements FullStateConfigSig {
288250

289251
predicate isBarrier(Node node, FlowState state) {
290252
getConfig(state).isBarrier(node, getState(state)) or
291-
getConfig(state).isBarrier(node) or
292-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getState(state), getConfig(state)) or
293-
any(BarrierGuardGuardedNodeBridge b).guardedNode(node, getConfig(state))
253+
getConfig(state).isBarrier(node)
294254
}
295255

296256
predicate isBarrierIn(Node node) { any(Configuration config).isBarrierIn(node) }

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

-25
Original file line numberDiff line numberDiff line change
@@ -874,28 +874,3 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
874874
)
875875
}
876876
}
877-
878-
/**
879-
* DEPRECATED: Use `BarrierGuard` module instead.
880-
*
881-
* A guard that validates some expression.
882-
*
883-
* To use this in a configuration, extend the class and provide a
884-
* characteristic predicate precisely specifying the guard, and override
885-
* `checks` to specify what is being validated and in which branch.
886-
*
887-
* It is important that all extending classes in scope are disjoint.
888-
*/
889-
deprecated class BarrierGuard extends GuardCondition {
890-
/** Override this predicate to hold if this guard validates `e` upon evaluating to `b`. */
891-
abstract predicate checks(Expr e, boolean b);
892-
893-
/** Gets a node guarded by this guard. */
894-
final ExprNode getAGuardedNode() {
895-
exists(SsaDefinition def, Variable v, boolean branch |
896-
result.getExpr() = def.getAUse(v) and
897-
this.checks(def.getAUse(v), branch) and
898-
this.controls(result.getExpr().getBasicBlock(), branch)
899-
)
900-
}
901-
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll

-27
Original file line numberDiff line numberDiff line change
@@ -116,33 +116,6 @@ abstract class Configuration extends DataFlow::Configuration {
116116

117117
final override predicate isBarrierOut(DataFlow::Node node) { this.isSanitizerOut(node) }
118118

119-
/**
120-
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
121-
*
122-
* Holds if taint propagation through nodes guarded by `guard` is prohibited.
123-
*/
124-
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard) { none() }
125-
126-
deprecated final override predicate isBarrierGuard(DataFlow::BarrierGuard guard) {
127-
this.isSanitizerGuard(guard)
128-
}
129-
130-
/**
131-
* DEPRECATED: Use `isSanitizer` and `BarrierGuard` module instead.
132-
*
133-
* Holds if taint propagation through nodes guarded by `guard` is prohibited
134-
* when the flow state is `state`.
135-
*/
136-
deprecated predicate isSanitizerGuard(DataFlow::BarrierGuard guard, DataFlow::FlowState state) {
137-
none()
138-
}
139-
140-
deprecated final override predicate isBarrierGuard(
141-
DataFlow::BarrierGuard guard, DataFlow::FlowState state
142-
) {
143-
this.isSanitizerGuard(guard, state)
144-
}
145-
146119
/**
147120
* Holds if taint may propagate from `node1` to `node2` in addition to the normal data-flow and taint steps.
148121
*/

0 commit comments

Comments
 (0)