Skip to content

Commit 5fafd9e

Browse files
authored
Merge branch 'main' into rb/rack-extend-app-and-resp
2 parents 9cf165a + 3cde59e commit 5fafd9e

File tree

335 files changed

+17706
-2866
lines changed

Some content is hidden

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

335 files changed

+17706
-2866
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Check implicit this warnings"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- "**qlpack.yml"
8+
branches:
9+
- main
10+
- "rc/*"
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Check that implicit this warnings is enabled for all packs
18+
shell: bash
19+
run: |
20+
EXIT_CODE=0
21+
packs="$(find . -iname 'qlpack.yml')"
22+
for pack_file in ${packs}; do
23+
option="$(yq '.warnOnImplicitThis' ${pack_file})"
24+
if [ "${option}" != "true" ]; then
25+
echo "::error file=${pack_file}::warnOnImplicitThis property must be set to 'true' for pack ${pack_file}"
26+
EXIT_CODE=1
27+
fi
28+
done
29+
exit "${EXIT_CODE}"

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ repos:
55
rev: v3.2.0
66
hooks:
77
- id: trailing-whitespace
8-
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
8+
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)|.*\.patch
99
- id: end-of-file-fixer
10-
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
10+
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)|.*\.patch
1111

1212
- repo: https://github.com/pre-commit/mirrors-clang-format
1313
rev: v13.0.1
@@ -21,6 +21,11 @@ repos:
2121
- id: autopep8
2222
files: ^misc/codegen/.*\.py
2323

24+
- repo: https://github.com/warchant/pre-commit-buildifier
25+
rev: 0.0.2
26+
hooks:
27+
- id: buildifier
28+
2429
- repo: local
2530
hooks:
2631
- id: codeql-format

cpp/downgrades/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ name: codeql/cpp-downgrades
22
groups: cpp
33
downgrades: .
44
library: true
5+
warnOnImplicitThis: true

cpp/ql/examples/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ groups:
44
- examples
55
dependencies:
66
codeql/cpp-all: ${workspace}
7+
warnOnImplicitThis: true

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ module Impl<FullStateConfigSig Config> {
460460
* The Boolean `cc` records whether the node is reached through an
461461
* argument in a call.
462462
*/
463-
pragma[assume_small_delta]
464463
private predicate fwdFlow(NodeEx node, Cc cc) {
465464
sourceNode(node, _) and
466465
if hasSourceCallCtx() then cc = true else cc = false
@@ -570,7 +569,6 @@ module Impl<FullStateConfigSig Config> {
570569
/**
571570
* Holds if `c` is the target of a store in the flow covered by `fwdFlow`.
572571
*/
573-
pragma[assume_small_delta]
574572
pragma[nomagic]
575573
private predicate fwdFlowConsCand(Content c) {
576574
exists(NodeEx mid, NodeEx node |
@@ -1216,7 +1214,6 @@ module Impl<FullStateConfigSig Config> {
12161214
fwdFlow1(_, _, _, _, _, _, t0, t, ap, _) and t0 != t
12171215
}
12181216

1219-
pragma[assume_small_delta]
12201217
pragma[nomagic]
12211218
private predicate fwdFlow0(
12221219
NodeEx node, FlowState state, Cc cc, ParamNodeOption summaryCtx, TypOption argT,
@@ -2777,7 +2774,6 @@ module Impl<FullStateConfigSig Config> {
27772774
/**
27782775
* Gets the number of `AccessPath`s that correspond to `apa`.
27792776
*/
2780-
pragma[assume_small_delta]
27812777
private int countAps(AccessPathApprox apa) {
27822778
evalUnfold(apa, false) and
27832779
result = 1 and
@@ -2796,7 +2792,6 @@ module Impl<FullStateConfigSig Config> {
27962792
* that it is expanded to a precise head-tail representation.
27972793
*/
27982794
language[monotonicAggregates]
2799-
pragma[assume_small_delta]
28002795
private int countPotentialAps(AccessPathApprox apa) {
28012796
apa instanceof AccessPathApproxNil and result = 1
28022797
or
@@ -2833,7 +2828,6 @@ module Impl<FullStateConfigSig Config> {
28332828
}
28342829

28352830
private newtype TPathNode =
2836-
pragma[assume_small_delta]
28372831
TPathNodeMid(
28382832
NodeEx node, FlowState state, CallContext cc, SummaryCtx sc, DataFlowType t, AccessPath ap
28392833
) {
@@ -2918,7 +2912,6 @@ module Impl<FullStateConfigSig Config> {
29182912

29192913
override AccessPathFrontHead getFront() { result = TFrontHead(head_) }
29202914

2921-
pragma[assume_small_delta]
29222915
override AccessPathApproxCons getApprox() {
29232916
result = TConsNil(head_, t) and tail_ = TAccessPathNil()
29242917
or
@@ -2927,7 +2920,6 @@ module Impl<FullStateConfigSig Config> {
29272920
result = TCons1(head_, this.length())
29282921
}
29292922

2930-
pragma[assume_small_delta]
29312923
override int length() { result = 1 + tail_.length() }
29322924

29332925
private string toStringImpl(boolean needsSuffix) {
@@ -3379,7 +3371,6 @@ module Impl<FullStateConfigSig Config> {
33793371
* Holds if data may flow from `mid` to `node`. The last step in or out of
33803372
* a callable is recorded by `cc`.
33813373
*/
3382-
pragma[assume_small_delta]
33833374
pragma[nomagic]
33843375
private predicate pathStep0(
33853376
PathNodeMid mid, NodeEx node, FlowState state, CallContext cc, SummaryCtx sc, DataFlowType t,
@@ -3592,7 +3583,6 @@ module Impl<FullStateConfigSig Config> {
35923583
)
35933584
}
35943585

3595-
pragma[assume_small_delta]
35963586
pragma[nomagic]
35973587
private predicate pathThroughCallable0(
35983588
DataFlowCall call, PathNodeMid mid, ReturnKindExt kind, FlowState state, CallContext cc,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private module LambdaFlow {
187187
else any()
188188
}
189189

190-
pragma[assume_small_delta]
191190
pragma[nomagic]
192191
predicate revLambdaFlow0(
193192
DataFlowCall lambdaCall, LambdaCallKind kind, Node node, DataFlowType t, boolean toReturn,
@@ -274,7 +273,6 @@ private module LambdaFlow {
274273
)
275274
}
276275

277-
pragma[assume_small_delta]
278276
pragma[nomagic]
279277
predicate revLambdaFlowOut(
280278
DataFlowCall lambdaCall, LambdaCallKind kind, TReturnPositionSimple pos, DataFlowType t,

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ module Impl<FullStateConfigSig Config> {
460460
* The Boolean `cc` records whether the node is reached through an
461461
* argument in a call.
462462
*/
463-
pragma[assume_small_delta]
464463
private predicate fwdFlow(NodeEx node, Cc cc) {
465464
sourceNode(node, _) and
466465
if hasSourceCallCtx() then cc = true else cc = false
@@ -570,7 +569,6 @@ module Impl<FullStateConfigSig Config> {
570569
/**
571570
* Holds if `c` is the target of a store in the flow covered by `fwdFlow`.
572571
*/
573-
pragma[assume_small_delta]
574572
pragma[nomagic]
575573
private predicate fwdFlowConsCand(Content c) {
576574
exists(NodeEx mid, NodeEx node |
@@ -1216,7 +1214,6 @@ module Impl<FullStateConfigSig Config> {
12161214
fwdFlow1(_, _, _, _, _, _, t0, t, ap, _) and t0 != t
12171215
}
12181216

1219-
pragma[assume_small_delta]
12201217
pragma[nomagic]
12211218
private predicate fwdFlow0(
12221219
NodeEx node, FlowState state, Cc cc, ParamNodeOption summaryCtx, TypOption argT,
@@ -2777,7 +2774,6 @@ module Impl<FullStateConfigSig Config> {
27772774
/**
27782775
* Gets the number of `AccessPath`s that correspond to `apa`.
27792776
*/
2780-
pragma[assume_small_delta]
27812777
private int countAps(AccessPathApprox apa) {
27822778
evalUnfold(apa, false) and
27832779
result = 1 and
@@ -2796,7 +2792,6 @@ module Impl<FullStateConfigSig Config> {
27962792
* that it is expanded to a precise head-tail representation.
27972793
*/
27982794
language[monotonicAggregates]
2799-
pragma[assume_small_delta]
28002795
private int countPotentialAps(AccessPathApprox apa) {
28012796
apa instanceof AccessPathApproxNil and result = 1
28022797
or
@@ -2833,7 +2828,6 @@ module Impl<FullStateConfigSig Config> {
28332828
}
28342829

28352830
private newtype TPathNode =
2836-
pragma[assume_small_delta]
28372831
TPathNodeMid(
28382832
NodeEx node, FlowState state, CallContext cc, SummaryCtx sc, DataFlowType t, AccessPath ap
28392833
) {
@@ -2918,7 +2912,6 @@ module Impl<FullStateConfigSig Config> {
29182912

29192913
override AccessPathFrontHead getFront() { result = TFrontHead(head_) }
29202914

2921-
pragma[assume_small_delta]
29222915
override AccessPathApproxCons getApprox() {
29232916
result = TConsNil(head_, t) and tail_ = TAccessPathNil()
29242917
or
@@ -2927,7 +2920,6 @@ module Impl<FullStateConfigSig Config> {
29272920
result = TCons1(head_, this.length())
29282921
}
29292922

2930-
pragma[assume_small_delta]
29312923
override int length() { result = 1 + tail_.length() }
29322924

29332925
private string toStringImpl(boolean needsSuffix) {
@@ -3379,7 +3371,6 @@ module Impl<FullStateConfigSig Config> {
33793371
* Holds if data may flow from `mid` to `node`. The last step in or out of
33803372
* a callable is recorded by `cc`.
33813373
*/
3382-
pragma[assume_small_delta]
33833374
pragma[nomagic]
33843375
private predicate pathStep0(
33853376
PathNodeMid mid, NodeEx node, FlowState state, CallContext cc, SummaryCtx sc, DataFlowType t,
@@ -3592,7 +3583,6 @@ module Impl<FullStateConfigSig Config> {
35923583
)
35933584
}
35943585

3595-
pragma[assume_small_delta]
35963586
pragma[nomagic]
35973587
private predicate pathThroughCallable0(
35983588
DataFlowCall call, PathNodeMid mid, ReturnKindExt kind, FlowState state, CallContext cc,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private module LambdaFlow {
187187
else any()
188188
}
189189

190-
pragma[assume_small_delta]
191190
pragma[nomagic]
192191
predicate revLambdaFlow0(
193192
DataFlowCall lambdaCall, LambdaCallKind kind, Node node, DataFlowType t, boolean toReturn,
@@ -274,7 +273,6 @@ private module LambdaFlow {
274273
)
275274
}
276275

277-
pragma[assume_small_delta]
278276
pragma[nomagic]
279277
predicate revLambdaFlowOut(
280278
DataFlowCall lambdaCall, LambdaCallKind kind, TReturnPositionSimple pos, DataFlowType t,

0 commit comments

Comments
 (0)