Skip to content

Update to CodeQL 2.9.4 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c/cert/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion c/cert/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: 2.6.0-dev
suites: codeql-suites
dependencies:
codeql/common-c-coding-standards: '*'
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
2 changes: 1 addition & 1 deletion c/cert/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion c/common/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion c/common/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: codeql/common-c-coding-standards
version: 2.6.0-dev
dependencies:
codeql/common-cpp-coding-standards: '*'
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
2 changes: 1 addition & 1 deletion c/common/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion c/misra/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion c/misra/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: 2.6.0-dev
suites: codeql-suites
dependencies:
codeql/common-c-coding-standards: '*'
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
2 changes: 1 addition & 1 deletion c/misra/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
3 changes: 3 additions & 0 deletions change_notes/2022-05-04-compiler-generated-fp-M0-1-4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `M0-1-4` - `SingleUsePODVariable.ql`
- This rule no longer considers compiler-generated access to a variable when determining if the
variable has a single use.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `A8-5-3` - `AvoidAutoWithBracedInitialization.ql`:
- Fix regression where `auto x{0}` was no longer detected as a braced initialization with type `auto` with the latest CodeQL versions.
- No longer falsely detect cases where braced initialization was not used, but where the inferred type would be `std::initializer_list`.
2 changes: 2 additions & 0 deletions change_notes/2022-07-15-fix-A7-3-1-location-reporting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A7-3-1` - `DefinitionNotConsideredForUnqualifiedLookup.ql`
- The locations reported for names occurring in using-declarations has improved in the latest CodeQL versions.
2 changes: 1 addition & 1 deletion codeql_modules/codeql
Submodule codeql updated 5768 files
2 changes: 1 addition & 1 deletion cpp/autosar/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/autosar/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: 2.6.0-dev
suites: codeql-suites
dependencies:
codeql/common-cpp-coding-standards: '*'
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ from Variable v
where
not isExcluded(v, InitializationPackage::avoidAutoWithBracedInitializationQuery()) and
v.getTypeWithAuto().getUnspecifiedType() instanceof AutoType and
v.getType().getUnspecifiedType().(Class).hasQualifiedName("std", "initializer_list")
v.getInitializer().isBraced()
select v, "Variable " + v.getName() + " of type auto uses braced initialization."
9 changes: 6 additions & 3 deletions cpp/autosar/src/rules/M0-1-4/SingleUsePODVariable.qll
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ int getUseCount(Variable v) {
// We enforce that it's a POD type variable, so if it has an initializer it is explicit
(if v.hasInitializer() then initializers = 1 else initializers = 0) and
result =
initializers + count(v.getAnAccess()) +
count(UserProvidedConstructorFieldInit cfi | cfi.getTarget() = v)
initializers +
count(VariableAccess access | access = v.getAnAccess() and not access.isCompilerGenerated())
+ count(UserProvidedConstructorFieldInit cfi | cfi.getTarget() = v)
)
}

Expand All @@ -23,7 +24,9 @@ Element getSingleUse(Variable v) {
or
result = any(UserProvidedConstructorFieldInit cfi | cfi.getTarget() = v)
or
result = v.getAnAccess()
exists(VariableAccess access |
access = v.getAnAccess() and not access.isCompilerGenerated() and result = access
)
)
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
| test.cpp:42:6:42:7 | declaration of f1 | Definition for 'f1' is not available for unqualified lookup because it is declared after $@ | test.cpp:39:1:39:13 | using f1 | using-declaration |
| test.cpp:42:6:42:7 | declaration of f1 | Definition for 'f1' is not available for unqualified lookup because it is declared after $@ | test.cpp:39:12:39:13 | using f1 | using-declaration |
15 changes: 8 additions & 7 deletions cpp/autosar/test/rules/A8-5-3/test.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include <initializer_list>

void test() {
auto a1(1); // COMPLIANT
auto a2{1}; // NON_COMPLIANT
auto a3 = 1; // COMPLIANT
auto a4 = {1}; // NON_COMPLIANT
int a5 = {1}; // COMPLIANT
const auto a6(1); // COMPLIANT
const auto a7{1}; // NON_COMPLIANT
auto a1(1); // COMPLIANT
auto a2{1}; // NON_COMPLIANT
auto a3 = 1; // COMPLIANT
auto a4 = {1}; // NON_COMPLIANT
int a5 = {1}; // COMPLIANT
const auto a6(1); // COMPLIANT
const auto a7{1}; // NON_COMPLIANT
auto a8 = std::initializer_list<int>(); // COMPLIANT
}
2 changes: 1 addition & 1 deletion cpp/cert/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/cert/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name: codeql/cert-cpp-coding-standards
version: 2.6.0-dev
suites: codeql-suites
dependencies:
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
codeql/common-cpp-coding-standards: '*'
2 changes: 1 addition & 1 deletion cpp/cert/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/common/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/common/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: codeql/common-cpp-coding-standards
version: 2.6.0-dev
dependencies:
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
2 changes: 1 addition & 1 deletion cpp/common/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/misra/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/misra/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: codeql/misra-cpp-coding-standards
version: 2.6.0-dev
dependencies:
codeql/common-cpp-coding-standards: '*'
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
2 changes: 1 addition & 1 deletion cpp/misra/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/report/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
dependencies:
codeql/cpp-all:
version: 0.0.13
version: 0.2.3
compiled: false
lockVersion: 1.0.0
2 changes: 1 addition & 1 deletion cpp/report/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: codeql/report-cpp-coding-standards
version: 2.6.0-dev
dependencies:
codeql/cpp-all: 0.0.13
codeql/cpp-all: 0.2.3
6 changes: 3 additions & 3 deletions supported_codeql_configs.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"supported_environment": [
{
"codeql_cli": "2.8.5",
"codeql_standard_library": "codeql-cli/v2.8.5",
"codeql_cli_bundle": "codeql-bundle-20220401"
"codeql_cli": "2.9.4",
"codeql_standard_library": "codeql-cli/v2.9.4",
"codeql_cli_bundle": "codeql-bundle-20220615"
}
],
"supported_language" : [
Expand Down