Skip to content

Commit 484d020

Browse files
committed
Merge branch 'main' into rdmarsh2/swift/autoclosure-cfg
2 parents dab9a85 + f1266a3 commit 484d020

File tree

332 files changed

+473
-5430
lines changed

Some content is hidden

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

332 files changed

+473
-5430
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ updates:
1717
ignore:
1818
- dependency-name: '*'
1919
update-types: ['version-update:semver-patch', 'version-update:semver-minor']
20+
21+
- package-ecosystem: "gomod"
22+
directory: "go"
23+
schedule:
24+
interval: "daily"
25+
allow:
26+
- dependency-name: "golang.org/x/mod"
27+
- dependency-name: "golang.org/x/tools"
28+
reviewers:
29+
- "github/codeql-go"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Deleted the deprecated `AnalysedString` class, use the new name `AnalyzedString`.
5+
* Deleted the deprecated `isBarrierGuard` predicate from the dataflow library and its uses, use `isBarrier` and the `BarrierGuard` module instead.

cpp/ql/lib/semmle/code/cpp/commons/StringAnalysis.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ predicate canValueFlow(Expr fromExpr, Expr toExpr) {
2727
fromExpr = toExpr.(ConditionalExpr).getElse()
2828
}
2929

30-
/** DEPRECATED: Alias for AnalyzedString */
31-
deprecated class AnalysedString = AnalyzedString;
32-
3330
/**
3431
* An analyzed null terminated string.
3532
*/

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

Lines changed: 1 addition & 41 deletions
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

Lines changed: 1 addition & 41 deletions
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

Lines changed: 1 addition & 41 deletions
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

Lines changed: 1 addition & 41 deletions
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

Lines changed: 1 addition & 41 deletions
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

Lines changed: 0 additions & 25 deletions
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-
}

0 commit comments

Comments
 (0)