Skip to content

Commit b23e482

Browse files
author
Paolo Tranquilli
committed
Merge branch 'main' into rust-experiment
2 parents 885e89a + 28a7fca commit b23e482

1,517 files changed

Lines changed: 24278 additions & 7864 deletions

File tree

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Pull Request checklist
2+
3+
#### All query authors
4+
5+
- [ ] A change note is added if necessary. See [the documentation](https://github.com/github/codeql/blob/main/docs/change-notes.md) in this repository.
6+
- [ ] All new queries have appropriate `.qhelp`. See [the documentation](https://github.com/github/codeql/blob/main/docs/query-help-style-guide.md) in this repository.
7+
- [ ] QL tests are added if necessary. See [Testing custom queries](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/testing-custom-queries) in the GitHub documentation.
8+
- [ ] New and changed queries have correct query metadata. See [the documentation](https://github.com/github/codeql/blob/main/docs/query-metadata-style-guide.md) in this repository.
9+
10+
#### Internal query authors only
11+
12+
- [ ] Autofixes generated based on these changes are valid, only needed if this PR makes significant changes to `.ql`, `.qll`, or `.qhelp` files. See [the documentation](https://github.com/github/codeql-team/blob/main/docs/best-practices/validating-autofix-for-query-changes.md) (internal access required).
13+
- [ ] Changes are validated [at scale](https://github.com/github/codeql-dca/) (internal access required).

.github/workflows/csharp-qltest.yml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,6 @@ permissions:
2929
contents: read
3030

3131
jobs:
32-
qlupgrade:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v4
36-
- uses: ./.github/actions/fetch-codeql
37-
- name: Check DB upgrade scripts
38-
run: |
39-
echo >empty.trap
40-
codeql dataset import -S ql/lib/upgrades/initial/semmlecode.csharp.dbscheme testdb empty.trap
41-
codeql dataset upgrade testdb --additional-packs ql/lib
42-
diff -q testdb/semmlecode.csharp.dbscheme ql/lib/semmlecode.csharp.dbscheme
43-
- name: Check DB downgrade scripts
44-
run: |
45-
echo >empty.trap
46-
rm -rf testdb; codeql dataset import -S ql/lib/semmlecode.csharp.dbscheme testdb empty.trap
47-
codeql resolve upgrades --format=lines --allow-downgrades --additional-packs downgrades \
48-
--dbscheme=ql/lib/semmlecode.csharp.dbscheme --target-dbscheme=downgrades/initial/semmlecode.csharp.dbscheme |
49-
xargs codeql execute upgrades testdb
50-
diff -q testdb/semmlecode.csharp.dbscheme downgrades/initial/semmlecode.csharp.dbscheme
51-
qltest:
52-
if: github.repository_owner == 'github'
53-
runs-on: ubuntu-latest-xl
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
slice: ["1/2", "2/2"]
58-
steps:
59-
- uses: actions/checkout@v4
60-
- uses: ./csharp/actions/create-extractor-pack
61-
- name: Cache compilation cache
62-
id: query-cache
63-
uses: ./.github/actions/cache-query-compilation
64-
with:
65-
key: csharp-qltest-${{ matrix.slice }}
66-
- name: Run QL tests
67-
run: |
68-
codeql test run --threads=0 --ram 50000 --slice ${{ matrix.slice }} --search-path "${{ github.workspace }}" --check-databases --check-undefined-labels --check-repeated-labels --check-redefined-labels --consistency-queries ql/consistency-queries ql/test --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
69-
env:
70-
GITHUB_TOKEN: ${{ github.token }}
7132
unit-tests:
7233
strategy:
7334
matrix:

.github/workflows/ruby-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ jobs:
140140
path: |
141141
${{ runner.temp }}/query-packs/*
142142
retention-days: 1
143+
include-hidden-files: true
143144

144145
package:
145146
runs-on: ubuntu-latest
@@ -176,6 +177,7 @@ jobs:
176177
name: codeql-ruby-pack
177178
path: ruby/codeql-ruby.zip
178179
retention-days: 1
180+
include-hidden-files: true
179181
- uses: actions/download-artifact@v3
180182
with:
181183
name: codeql-ruby-queries
@@ -193,6 +195,7 @@ jobs:
193195
name: codeql-ruby-bundle
194196
path: ruby/codeql-ruby-bundle.zip
195197
retention-days: 1
198+
include-hidden-files: true
196199

197200
test:
198201
defaults:

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local_path_override(
1515
# see https://registry.bazel.build/ for a list of available packages
1616

1717
bazel_dep(name = "platforms", version = "0.0.10")
18-
bazel_dep(name = "rules_go", version = "0.49.0")
18+
bazel_dep(name = "rules_go", version = "0.50.0")
1919
bazel_dep(name = "rules_pkg", version = "0.10.1")
2020
bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1")
2121
bazel_dep(name = "rules_python", version = "0.32.2")
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Approach: replace conversion expressions of kind 389 (= @c11_generic) by
3+
* conversion expressions of kind 12 (= @parexpr), i.e., a `ParenthesisExpr`,
4+
* and drop the relation which its child expressions, which are just syntactic
5+
* sugar. Parenthesis expressions are equally benign as C11 _Generic expressions,
6+
* and behave similarly in the context of the IR.
7+
*/
8+
9+
class Expr extends @expr {
10+
string toString() { none() }
11+
}
12+
13+
class Location extends @location {
14+
string toString() { none() }
15+
}
16+
17+
class ExprParent extends @exprparent {
18+
string toString() { none() }
19+
}
20+
21+
query predicate new_exprs(Expr expr, int new_kind, Location loc) {
22+
exists(int kind | exprs(expr, kind, loc) | if kind = 389 then new_kind = 12 else new_kind = kind)
23+
}
24+
25+
query predicate new_exprparents(Expr expr, int index, ExprParent expr_parent) {
26+
exprparents(expr, index, expr_parent) and
27+
(
28+
not expr_parent instanceof @expr
29+
or
30+
exists(int kind | exprs(expr_parent.(Expr), kind, _) | kind != 389)
31+
)
32+
}

0 commit comments

Comments
 (0)