Skip to content

Commit 7482603

Browse files
committed
Merge branch 'main' into loc2 and accept new test results.
2 parents caca495 + 01c9509 commit 7482603

File tree

726 files changed

+8058
-4563
lines changed

Some content is hidden

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

726 files changed

+8058
-4563
lines changed

MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ use_repo(
128128
"kotlin-compiler-1.9.20-Beta",
129129
"kotlin-compiler-2.0.0-RC1",
130130
"kotlin-compiler-2.0.20-Beta2",
131+
"kotlin-compiler-2.1.0-Beta1",
131132
"kotlin-compiler-embeddable-1.5.0",
132133
"kotlin-compiler-embeddable-1.5.10",
133134
"kotlin-compiler-embeddable-1.5.20",
@@ -141,6 +142,7 @@ use_repo(
141142
"kotlin-compiler-embeddable-1.9.20-Beta",
142143
"kotlin-compiler-embeddable-2.0.0-RC1",
143144
"kotlin-compiler-embeddable-2.0.20-Beta2",
145+
"kotlin-compiler-embeddable-2.1.0-Beta1",
144146
"kotlin-stdlib-1.5.0",
145147
"kotlin-stdlib-1.5.10",
146148
"kotlin-stdlib-1.5.20",
@@ -154,6 +156,7 @@ use_repo(
154156
"kotlin-stdlib-1.9.20-Beta",
155157
"kotlin-stdlib-2.0.0-RC1",
156158
"kotlin-stdlib-2.0.20-Beta2",
159+
"kotlin-stdlib-2.1.0-Beta1",
157160
)
158161

159162
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

config/identical-files.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll",
5858
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll"
5959
],
60-
"Model as Data Generation Java/C# - CaptureModels": [
61-
"java/ql/src/utils/modelgenerator/internal/CaptureModels.qll",
62-
"csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll"
63-
],
6460
"Sign Java/C#": [
6561
"java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll",
6662
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll"

cpp/ql/lib/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.1
2+
3+
No user-facing changes.
4+
15
## 2.0.0
26

37
### Breaking Changes
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 2.0.1
2+
3+
No user-facing changes.

cpp/ql/lib/codeql-pack.release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 2.0.0
2+
lastReleaseVersion: 2.0.1

cpp/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-all
2-
version: 2.0.1-dev
2+
version: 2.0.2-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

cpp/ql/lib/semmle/code/cpp/Function.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,8 @@ class FunctionDeclarationEntry extends DeclarationEntry, @fun_decl {
651651

652652
/**
653653
* Holds if this declaration is an implicit function declaration, that is,
654-
* where a function is used before it is declared (under older C standards).
654+
* where a function is used before it is declared (under older C standards,
655+
* or when there were parse errors).
655656
*/
656657
predicate isImplicit() { fun_implicit(underlyingElement(this)) }
657658

cpp/ql/lib/semmle/code/cpp/Type.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class Type extends Locatable, @type {
3939

4040
/**
4141
* Gets a specifier of this type, recursively looking through `typedef` and
42-
* `decltype`. For example, in the context of `typedef const int *restrict
43-
* t`, the type `volatile t` has specifiers `volatile` and `restrict` but not
42+
* `decltype`. For example, in the context of `typedef const int *restrict t`,
43+
* the type `volatile t` has specifiers `volatile` and `restrict` but not
4444
* `const` since the `const` is attached to the type being pointed to rather
4545
* than the pointer itself.
4646
*/

cpp/ql/lib/semmle/code/cpp/models/interfaces/FormattingFunction.qll

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,34 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
118118

119119
/**
120120
* Gets the position of the first format argument, corresponding with
121-
* the first format specifier in the format string.
121+
* the first format specifier in the format string. We ignore all
122+
* implicit function definitions.
122123
*/
123124
int getFirstFormatArgumentIndex() {
124-
result = this.getNumberOfParameters() and
125-
// the formatting function either has a definition in the snapshot, or all
125+
// The formatting function either has a definition in the snapshot, or all
126126
// `DeclarationEntry`s agree on the number of parameters (otherwise we don't
127127
// really know the correct number)
128-
(
129-
this.hasDefinition()
130-
or
131-
forall(FunctionDeclarationEntry fde | fde = this.getADeclarationEntry() |
132-
result = fde.getNumberOfParameters()
133-
)
128+
if this.hasDefinition()
129+
then result = this.getDefinition().getNumberOfParameters()
130+
else result = this.getNumberOfExplicitParameters()
131+
}
132+
133+
/**
134+
* Gets a non-implicit function declaration entry.
135+
*/
136+
private FunctionDeclarationEntry getAnExplicitDeclarationEntry() {
137+
result = this.getADeclarationEntry() and
138+
not result.isImplicit()
139+
}
140+
141+
/**
142+
* Gets the number of parameters, excluding any parameters that have been defined
143+
* from implicit function declarations. If there is some inconsistency in the number
144+
* of parameters, then don't return anything.
145+
*/
146+
private int getNumberOfExplicitParameters() {
147+
forex(FunctionDeclarationEntry fde | fde = this.getAnExplicitDeclarationEntry() |
148+
result = fde.getNumberOfParameters()
134149
)
135150
}
136151

cpp/ql/lib/semmle/code/cpp/security/flowafterfree/FlowAfterFree.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ module FlowFromFree<FlowFromFreeParamSig P> {
7272

7373
predicate isSource(DataFlow::Node node, FlowState state) { isFree(node, _, state, _) }
7474

75-
pragma[inline]
7675
predicate isSink(DataFlow::Node sink, FlowState state) {
7776
exists(Expr e, DataFlow::Node source, DeallocationExpr dealloc |
7877
P::isSink(sink, e) and

0 commit comments

Comments
 (0)