Skip to content

Commit 58e4861

Browse files
committed
Merge branch 'main' into rc/3.7
2 parents 01a043d + b49487c commit 58e4861

File tree

2,309 files changed

+133477
-42938
lines changed

Some content is hidden

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

2,309 files changed

+133477
-42938
lines changed

.bazelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
build --repo_env=CC=clang --repo_env=CXX=clang++ --copt="-std=c++17"
1+
build --repo_env=CC=clang --repo_env=CXX=clang++ --cxxopt="-std=c++17"
22

33
try-import %workspace%/local.bazelrc

.github/workflows/check-qldoc.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
run: |
2828
EXIT_CODE=0
2929
# TODO: remove the swift exception from the regex when we fix generated QLdoc
30-
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!swift)[a-z]*/ql/lib' || true; } | sort -u)"
30+
# TODO: remove the shared exception from the regex when coverage of qlpacks without dbschemes is supported
31+
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(swift|shared))[a-z]*/ql/lib' || true; } | sort -u)"
3132
for pack_dir in ${changed_lib_packs}; do
3233
lang="${pack_dir%/ql/lib}"
3334
codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# uses a compiled language
5757

5858
- run: |
59-
dotnet build csharp /p:UseSharedCompilation=false
59+
dotnet build csharp
6060
6161
- name: Perform CodeQL Analysis
6262
uses: github/codeql-action/analyze@main

.github/workflows/csv-coverage-metrics.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
DATABASE="${{ runner.temp }}/csharp-database"
5656
PROJECT="${{ runner.temp }}/csharp-project"
5757
dotnet new classlib --language=C# --output="$PROJECT"
58-
codeql database create "$DATABASE" --language=csharp --source-root="$PROJECT" --command 'dotnet build /t:rebuild csharp-project.csproj /p:UseSharedCompilation=false'
58+
codeql database create "$DATABASE" --language=csharp --source-root="$PROJECT" --command 'dotnet build /t:rebuild csharp-project.csproj'
5959
- name: Capture coverage information
6060
run: |
6161
DATABASE="${{ runner.temp }}/csharp-database"

.github/workflows/ql-for-ql-build.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
paths:
9+
- "ql/**"
10+
- "**.qll"
11+
- "**.ql"
12+
- "**.dbscheme"
13+
- "**/qlpack.yml"
14+
- ".github/workflows/ql-for-ql-build.yml"
815

916
env:
1017
CARGO_TERM_COLOR: always
@@ -54,7 +61,7 @@ jobs:
5461
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
5562
env:
5663
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
57-
64+
5865
### Build the extractor ###
5966
- name: Cache entire extractor
6067
if: steps.cache-pack.outputs.cache-hit != 'true'
@@ -108,22 +115,22 @@ jobs:
108115
### Run the analysis ###
109116
- name: Hack codeql-action options
110117
run: |
111-
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
118+
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .resolve.languages=["--search-path", $pack] | .database.init=["--search-path", $pack]')
112119
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
113120
env:
114121
PACK: ${{ runner.temp }}/pack
115122

116123
- name: Create CodeQL config file
117124
run: |
118125
echo "paths-ignore:" >> ${CONF}
119-
echo " - ql/ql/test" >> ${CONF}
120-
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
126+
echo " - ql/ql/test" >> ${CONF}
127+
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
121128
echo "disable-default-queries: true" >> ${CONF}
122129
echo "queries:" >> ${CONF}
123130
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
124131
echo "Config file: "
125132
cat ${CONF}
126-
env:
133+
env:
127134
CONF: ./ql-for-ql-config.yml
128135
- name: Initialize CodeQL
129136
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
@@ -139,13 +146,13 @@ jobs:
139146

140147
- name: Perform CodeQL Analysis
141148
uses: github/codeql-action/analyze@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
142-
with:
149+
with:
143150
category: "ql-for-ql"
144151
- name: Copy sarif file to CWD
145152
run: cp ../results/ql.sarif ./ql-for-ql.sarif
146153
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
147154
run: |
148-
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
155+
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
149156
- name: Sarif as artifact
150157
uses: actions/upload-artifact@v3
151158
with:

.github/workflows/ruby-build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
uses: ./.github/actions/fetch-codeql
9696
- name: Build Query Pack
9797
run: |
98+
codeql pack create ../shared/ssa --output target/packs
9899
codeql pack create ql/lib --output target/packs
99100
codeql pack install ql/src
100101
codeql pack create ql/src --output target/packs

.github/workflows/swift-codegen.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
paths:
66
- "swift/**"
7+
- "misc/bazel/**"
8+
- "*.bazel*"
79
- .github/workflows/swift-codegen.yml
810
- .github/actions/fetch-codeql/action.yml
911
branches:

.github/workflows/swift-integration-tests.yml

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
paths:
66
- "swift/**"
7+
- "misc/bazel/**"
8+
- "*.bazel*"
79
- .github/workflows/swift-integration-tests.yml
810
- .github/actions/fetch-codeql/action.yml
911
- codeql-workspace.yml
@@ -30,6 +32,14 @@ jobs:
3032
- name: Build Swift extractor
3133
run: |
3234
bazel run //swift:create-extractor-pack
35+
- name: Get Swift version
36+
id: get_swift_version
37+
run: |
38+
VERSION=$(bazel run //swift/extractor -- --version | sed -ne 's/.*version \(\S*\).*/\1/p')
39+
echo "::set-output name=version::$VERSION"
40+
- uses: swift-actions/setup-swift@v1
41+
with:
42+
swift-version: "${{steps.get_swift_version.outputs.version}}"
3343
- name: Run integration tests
3444
run: |
3545
python integration-tests/runner.py

.github/workflows/swift-qltest.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
paths:
66
- "swift/**"
7+
- "misc/bazel/**"
8+
- "*.bazel*"
79
- .github/workflows/swift-qltest.yml
810
- .github/actions/fetch-codeql/action.yml
911
- codeql-workspace.yml

CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
# Bazel (excluding BUILD.bazel files)
3232
WORKSPACE.bazel @github/codeql-ci-reviewers
33+
.bazelversion @github/codeql-ci-reviewers
34+
.bazelrc @github/codeql-ci-reviewers
3335
**/*.bzl @github/codeql-ci-reviewers
3436

3537
# Documentation etc

codeql-workspace.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ provide:
44
- "*/ql/test/qlpack.yml"
55
- "*/ql/examples/qlpack.yml"
66
- "*/ql/consistency-queries/qlpack.yml"
7+
- "shared/*/qlpack.yml"
78
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
89
- "go/ql/config/legacy-support/qlpack.yml"
910
- "go/build/codeql-extractor-go/codeql-extractor.yml"

config/identical-files.json

+18-16
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
1818
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
1919
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
20+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll",
21+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll",
22+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll",
23+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll",
2024
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll",
2125
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll",
2226
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll",
@@ -30,12 +34,14 @@
3034
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
3135
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
3236
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForLibraries.qll",
37+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",
3338
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
3439
],
3540
"DataFlow Java/C++/C#/Python Common": [
3641
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
3742
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll",
3843
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
44+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
3945
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll",
4046
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll",
4147
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll",
@@ -47,6 +53,9 @@
4753
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
4854
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
4955
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
56+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
57+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
58+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
5059
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
5160
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking2/TaintTrackingImpl.qll",
5261
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/tainttracking3/TaintTrackingImpl.qll",
@@ -67,15 +76,17 @@
6776
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
6877
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll",
6978
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
79+
"cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
7080
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
7181
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll",
7282
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll",
7383
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll"
7484
],
75-
"DataFlow Java/C# Flow Summaries": [
85+
"DataFlow Java/C#/Ruby/Python/Swift Flow Summaries": [
7686
"java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll",
7787
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll",
7888
"ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll",
89+
"python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll",
7990
"swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll"
8091
],
8192
"SsaReadPosition Java/C#": [
@@ -460,15 +471,6 @@
460471
"javascript/ql/lib/IDEContextual.qll",
461472
"python/ql/lib/analysis/IDEContextual.qll"
462473
],
463-
"SSA C#": [
464-
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll",
465-
"csharp/ql/lib/semmle/code/csharp/controlflow/internal/pressa/SsaImplCommon.qll",
466-
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll",
467-
"csharp/ql/lib/semmle/code/cil/internal/SsaImplCommon.qll",
468-
"ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImplCommon.qll",
469-
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll",
470-
"swift/ql/lib/codeql/swift/dataflow/internal/SsaImplCommon.qll"
471-
],
472474
"CryptoAlgorithms Python/JS/Ruby": [
473475
"javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll",
474476
"python/ql/lib/semmle/python/concepts/CryptoAlgorithms.qll",
@@ -540,7 +542,7 @@
540542
"java/ql/lib/semmle/code/java/dataflow/internal/AccessPathSyntax.qll",
541543
"javascript/ql/lib/semmle/javascript/frameworks/data/internal/AccessPathSyntax.qll",
542544
"ruby/ql/lib/codeql/ruby/dataflow/internal/AccessPathSyntax.qll",
543-
"python/ql/lib/semmle/python/frameworks/data/internal/AccessPathSyntax.qll",
545+
"python/ql/lib/semmle/python/dataflow/new/internal/AccessPathSyntax.qll",
544546
"swift/ql/lib/codeql/swift/dataflow/internal/AccessPathSyntax.qll"
545547
],
546548
"IncompleteUrlSubstringSanitization": [
@@ -584,22 +586,22 @@
584586
],
585587
"Swift declarations test file": [
586588
"swift/ql/test/extractor-tests/declarations/declarations.swift",
587-
"swift/ql/test/library-tests/parent/declarations.swift"
589+
"swift/ql/test/library-tests/ast/declarations.swift"
588590
],
589591
"Swift statements test file": [
590592
"swift/ql/test/extractor-tests/statements/statements.swift",
591-
"swift/ql/test/library-tests/parent/statements.swift"
593+
"swift/ql/test/library-tests/ast/statements.swift"
592594
],
593595
"Swift expressions test file": [
594596
"swift/ql/test/extractor-tests/expressions/expressions.swift",
595-
"swift/ql/test/library-tests/parent/expressions.swift"
597+
"swift/ql/test/library-tests/ast/expressions.swift"
596598
],
597599
"Swift patterns test file": [
598600
"swift/ql/test/extractor-tests/patterns/patterns.swift",
599-
"swift/ql/test/library-tests/parent/patterns.swift"
601+
"swift/ql/test/library-tests/ast/patterns.swift"
600602
],
601603
"IncompleteMultiCharacterSanitization JS/Ruby": [
602604
"javascript/ql/lib/semmle/javascript/security/IncompleteMultiCharacterSanitizationQuery.qll",
603605
"ruby/ql/lib/codeql/ruby/security/IncompleteMultiCharacterSanitizationQuery.qll"
604606
]
605-
}
607+
}

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public void TestCppAutobuilderSuccess()
299299
{
300300
Actions.RunProcess[@"cmd.exe /C nuget restore C:\Project\test.sln -DisableParallelProcessing"] = 1;
301301
Actions.RunProcess[@"cmd.exe /C C:\Project\.nuget\nuget.exe restore C:\Project\test.sln -DisableParallelProcessing"] = 0;
302-
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && set Platform=&& type NUL && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /p:UseSharedCompilation=false /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
302+
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && set Platform=&& type NUL && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
303303
Actions.RunProcessOut[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = "";
304304
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = 1;
305305
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationVersion"] = 0;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Expr extends @expr {
2+
string toString() { none() }
3+
}
4+
5+
class Location extends @location_expr {
6+
string toString() { none() }
7+
}
8+
9+
predicate isExprWithNewBuiltin(Expr expr) {
10+
exists(int kind | exprs(expr, kind, _) | 336 <= kind and kind <= 362)
11+
}
12+
13+
from Expr expr, int kind, int kind_new, Location location
14+
where
15+
exprs(expr, kind, location) and
16+
if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind
17+
select expr, kind_new, location

0 commit comments

Comments
 (0)