Skip to content

Commit 6d267be

Browse files
committed
C++: merge main and accept test changes
2 parents de68107 + 439dcc0 commit 6d267be

File tree

1,952 files changed

+134313
-25140
lines changed

Some content is hidden

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

1,952 files changed

+134313
-25140
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"rust-lang.rust",
44
"bungcip.better-toml",
55
"github.vscode-codeql",
6+
"hbenl.vscode-test-explorer",
7+
"ms-vscode.test-adapter-converter",
68
"slevesque.vscode-zipexplorer"
79
],
810
"settings": {

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Java:
1111
- change-notes/**/*java.*
1212

1313
JS:
14-
- javascript/**/*
14+
- any: [ 'javascript/**/*', '!javascript/ql/experimental/adaptivethreatmodeling/**/*' ]
1515
- change-notes/**/*javascript*
1616

1717
Python:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup dotnet
3131
uses: actions/setup-dotnet@v2
3232
with:
33-
dotnet-version: 6.0.101
33+
dotnet-version: 6.0.202
3434

3535
- name: Checkout repository
3636
uses: actions/checkout@v3

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
path: metrics-java.sarif
3939
retention-days: 20
4040
- name: Upload SARIF file
41-
uses: github/codeql-action/upload-sarif@v1
41+
uses: github/codeql-action/upload-sarif@main
4242
with:
4343
sarif_file: metrics-java.sarif
4444

@@ -65,6 +65,6 @@ jobs:
6565
path: metrics-csharp.sarif
6666
retention-days: 20
6767
- name: Upload SARIF file
68-
uses: github/codeql-action/upload-sarif@v1
68+
uses: github/codeql-action/upload-sarif@main
6969
with:
7070
sarif_file: metrics-csharp.sarif

.github/workflows/query-list.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,15 @@ jobs:
3030
with:
3131
python-version: 3.8
3232
- name: Download CodeQL CLI
33-
uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c
34-
with:
35-
repo: "github/codeql-cli-binaries"
36-
version: "latest"
37-
file: "codeql-linux64.zip"
38-
token: ${{ secrets.GITHUB_TOKEN }}
33+
# Look under the `codeql` directory, as this is where we checked out the `github/codeql` repo
34+
uses: ./codeql/.github/actions/fetch-codeql
3935
- name: Unzip CodeQL CLI
4036
run: unzip -d codeql-cli codeql-linux64.zip
4137
- name: Build code scanning query list
4238
run: |
43-
PATH="$PATH:codeql-cli/codeql" python codeql/misc/scripts/generate-code-scanning-query-list.py > code-scanning-query-list.csv
39+
python codeql/misc/scripts/generate-code-scanning-query-list.py > code-scanning-query-list.csv
4440
- name: Upload code scanning query list
4541
uses: actions/upload-artifact@v3
4642
with:
4743
name: code-scanning-query-list
4844
path: code-scanning-query-list.csv
49-

.github/workflows/swift-codegen.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ jobs:
1818
- name: Run unit tests
1919
run: |
2020
bazel test //swift/codegen/test --test_output=errors
21-
- name: Check that code was generated
21+
- name: Check that QL generated code was checked in
2222
run: |
2323
bazel run //swift/codegen
2424
git add swift
2525
git diff --exit-code --stat HEAD
26+
- name: Generate C++ files
27+
run: |
28+
bazel run //swift/codegen:trapgen -- --cpp-output=$PWD/swift-generated-headers
29+
bazel run //swift/codegen:cppgen -- --cpp-output=$PWD/swift-generated-headers
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: swift-generated-headers
33+
path: swift-generated-headers/*.h

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@ csharp/extractor/Semmle.Extraction.CSharp.Driver/Properties/launchSettings.json
3737
# links created by bazel
3838
/bazel-*
3939

40+
# local bazel options
41+
/local.bazelrc
42+
4043
# CLion project files
4144
/.clwb

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
/javascript/ @github/codeql-javascript
55
/python/ @github/codeql-python
66
/ruby/ @github/codeql-ruby
7+
/swift/ @github/codeql-c
8+
/java/kotlin-extractor/ @github/codeql-kotlin
9+
/java/kotlin-explorer/ @github/codeql-kotlin
710

811
# ML-powered queries
912
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers

config/identical-files.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,20 +475,23 @@
475475
"python/ql/lib/semmle/python/security/internal/SensitiveDataHeuristics.qll",
476476
"ruby/ql/lib/codeql/ruby/security/internal/SensitiveDataHeuristics.qll"
477477
],
478-
"ReDoS Util Python/JS/Ruby": [
478+
"ReDoS Util Python/JS/Ruby/Java": [
479479
"javascript/ql/lib/semmle/javascript/security/performance/ReDoSUtil.qll",
480480
"python/ql/lib/semmle/python/security/performance/ReDoSUtil.qll",
481-
"ruby/ql/lib/codeql/ruby/security/performance/ReDoSUtil.qll"
481+
"ruby/ql/lib/codeql/ruby/security/performance/ReDoSUtil.qll",
482+
"java/ql/lib/semmle/code/java/security/performance/ReDoSUtil.qll"
482483
],
483-
"ReDoS Exponential Python/JS/Ruby": [
484+
"ReDoS Exponential Python/JS/Ruby/Java": [
484485
"javascript/ql/lib/semmle/javascript/security/performance/ExponentialBackTracking.qll",
485486
"python/ql/lib/semmle/python/security/performance/ExponentialBackTracking.qll",
486-
"ruby/ql/lib/codeql/ruby/security/performance/ExponentialBackTracking.qll"
487+
"ruby/ql/lib/codeql/ruby/security/performance/ExponentialBackTracking.qll",
488+
"java/ql/lib/semmle/code/java/security/performance/ExponentialBackTracking.qll"
487489
],
488-
"ReDoS Polynomial Python/JS/Ruby": [
490+
"ReDoS Polynomial Python/JS/Ruby/Java": [
489491
"javascript/ql/lib/semmle/javascript/security/performance/SuperlinearBackTracking.qll",
490492
"python/ql/lib/semmle/python/security/performance/SuperlinearBackTracking.qll",
491-
"ruby/ql/lib/codeql/ruby/security/performance/SuperlinearBackTracking.qll"
493+
"ruby/ql/lib/codeql/ruby/security/performance/SuperlinearBackTracking.qll",
494+
"java/ql/lib/semmle/code/java/security/performance/SuperlinearBackTracking.qll"
492495
],
493496
"BadTagFilterQuery Python/JS/Ruby": [
494497
"javascript/ql/lib/semmle/javascript/security/BadTagFilterQuery.qll",
@@ -550,5 +553,9 @@
550553
"HttpToFileAccessCustomizations JS/Ruby": [
551554
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
552555
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
556+
],
557+
"Typo database": [
558+
"javascript/ql/src/Expressions/TypoDatabase.qll",
559+
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"
553560
]
554561
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
class Expr extends @expr {
6+
string toString() { none() }
7+
}
8+
9+
class Stmt extends @stmt {
10+
string toString() { none() }
11+
}
12+
13+
predicate isStmtWithInitializer(Stmt stmt) {
14+
exists(int kind | stmts(stmt, kind, _) | kind = 2 or kind = 11 or kind = 35)
15+
}
16+
17+
from Expr child, int index, int index_new, Element parent
18+
where
19+
exprparents(child, index, parent) and
20+
if isStmtWithInitializer(parent) then index_new = index - 1 else index_new = index
21+
select child, index_new, parent

0 commit comments

Comments
 (0)