Skip to content

Commit c0a755e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into igfoo/kotlin_merge
Resolving conflicts: java/ql/lib/semmle/code/java/Expr.qll
2 parents b7a0b56 + 46f309c commit c0a755e

File tree

600 files changed

+26740
-5285
lines changed

Some content is hidden

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

600 files changed

+26740
-5285
lines changed

.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-

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,22 +4300,26 @@ private module Subpaths {
43004300
)
43014301
}
43024302

4303+
pragma[nomagic]
4304+
private predicate hasSuccessor(PathNode pred, PathNodeMid succ, NodeEx succNode) {
4305+
succ = pred.getASuccessor() and
4306+
succNode = succ.getNodeEx()
4307+
}
4308+
43034309
/**
43044310
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
43054311
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
43064312
* `ret -> out` is summarized as the edge `arg -> out`.
43074313
*/
43084314
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
43094315
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4310-
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](par) and
4311-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4316+
pragma[only_bind_into](arg).getASuccessor() = pragma[only_bind_into](out0) and
43124317
subpaths03(pragma[only_bind_into](arg), p, localStepToHidden*(ret), o, sout, apout) and
4318+
hasSuccessor(pragma[only_bind_into](arg), par, p) and
43134319
not ret.isHidden() and
4314-
par.getNodeEx() = p and
4315-
out0.getNodeEx() = o and
4316-
out0.getState() = sout and
4317-
out0.getAp() = apout and
4318-
(out = out0 or out = out0.projectToSink())
4320+
pathNode(out0, o, sout, _, _, apout, _, _)
4321+
|
4322+
out = out0 or out = out0.projectToSink()
43194323
)
43204324
}
43214325

0 commit comments

Comments
 (0)