Skip to content

Upgrade github/codeql dependency to 2.20.7 #913

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
20 changes: 10 additions & 10 deletions c/cert/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
2 changes: 1 addition & 1 deletion c/cert/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ license: MIT
default-suite-file: codeql-suites/cert-c-default.qls
dependencies:
codeql/common-c-coding-standards: '*'
codeql/cpp-all: 2.1.1
codeql/cpp-all: 4.0.3
26 changes: 15 additions & 11 deletions c/cert/src/rules/DCL40-C/IncompatibleFunctionDeclarations.ql
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,32 @@ import codingstandards.c.cert
import codingstandards.cpp.types.Compatible
import ExternalIdentifiers

predicate interestedInFunctions(FunctionDeclarationEntry f1, FunctionDeclarationEntry f2) {
predicate interestedInFunctions(
FunctionDeclarationEntry f1, FunctionDeclarationEntry f2, ExternalIdentifiers d
) {
not f1 = f2 and
f1.getDeclaration() = f2.getDeclaration() and
f1.getName() = f2.getName()
d = f1.getDeclaration() and
d = f2.getDeclaration()
}

predicate interestedInFunctions(FunctionDeclarationEntry f1, FunctionDeclarationEntry f2) {
interestedInFunctions(f1, f2, _)
}

module FuncDeclEquiv =
FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>;

from ExternalIdentifiers d, FunctionDeclarationEntry f1, FunctionDeclarationEntry f2
where
not isExcluded(f1, Declarations2Package::incompatibleFunctionDeclarationsQuery()) and
not isExcluded(f2, Declarations2Package::incompatibleFunctionDeclarationsQuery()) and
not f1 = f2 and
f1.getDeclaration() = d and
f2.getDeclaration() = d and
f1.getName() = f2.getName() and
interestedInFunctions(f1, f2, d) and
(
//return type check
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalReturnTypes(f1,
f2)
not FuncDeclEquiv::equalReturnTypes(f1, f2)
or
//parameter type check
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalParameterTypes(f1,
f2)
not FuncDeclEquiv::equalParameterTypes(f1, f2)
) and
// Apply ordering on start line, trying to avoid the optimiser applying this join too early
// in the pipeline
Expand Down
20 changes: 10 additions & 10 deletions c/cert/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
20 changes: 10 additions & 10 deletions c/common/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
2 changes: 1 addition & 1 deletion c/common/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: 2.48.0-dev
license: MIT
dependencies:
codeql/common-cpp-coding-standards: '*'
codeql/cpp-all: 2.1.1
codeql/cpp-all: 4.0.3
20 changes: 10 additions & 10 deletions c/common/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
20 changes: 10 additions & 10 deletions c/misra/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
2 changes: 1 addition & 1 deletion c/misra/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ license: MIT
default-suite-file: codeql-suites/misra-c-default.qls
dependencies:
codeql/common-c-coding-standards: '*'
codeql/cpp-all: 2.1.1
codeql/cpp-all: 4.0.3
2 changes: 1 addition & 1 deletion c/misra/src/rules/RULE-2-4/UnusedTagDeclaration.ql
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ where
// `isInMacroExpansion` is broken for `UserType`s.
not s.isInMacroExpansion() and
// Exclude template parameters, in case this is run on C++ code.
not s instanceof TemplateParameter
not s instanceof TypeTemplateParameter
select s, "struct " + s.getName() + " has an unused tag."
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ predicate matchesSign(IntegerConstantMacro macro, PossiblyNegativeLiteral litera
literal.isNegative() implies macro.isSigned()
}

bindingset[literal]
predicate matchesSize(IntegerConstantMacro macro, PossiblyNegativeLiteral literal) {
literal.getRawValue() <= macro.maxValue() and
literal.getRawValue() >= macro.minValue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ predicate interestedInFunctions(FunctionDeclarationEntry f1, FunctionDeclaration
f1.getDeclaration() instanceof ExternalIdentifiers and
f1.isDefinition() and
f1.getDeclaration() = f2.getDeclaration() and
// This condition should always hold, but removing it affects join order performance.
f1.getName() = f2.getName() and
not f2.isDefinition() and
not f1.isFromTemplateInstantiation(_) and
not f2.isFromTemplateInstantiation(_)
}

module FunDeclEquiv =
FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>;

from FunctionDeclarationEntry f1
where
not isExcluded(f1, Declarations4Package::compatibleDeclarationFunctionDefinedQuery()) and
Expand All @@ -44,17 +45,13 @@ where
or
//or one exists that is close but incompatible in some way
exists(FunctionDeclarationEntry f2 |
f1.getName() = f2.getName() and
not f2.isDefinition() and
f2.getDeclaration() = f1.getDeclaration() and
interestedInFunctions(f1, f2) and
(
//return types differ
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalReturnTypes(f1,
f2)
not FunDeclEquiv::equalReturnTypes(f1, f2)
or
//parameter types differ
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalParameterTypes(f1,
f2)
not FunDeclEquiv::equalParameterTypes(f1, f2)
or
//parameter names differ
parameterNamesUnmatched(f1, f2)
Expand Down
20 changes: 10 additions & 10 deletions c/misra/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
4 changes: 4 additions & 0 deletions change_notes/2025-7-15-fix-performance-issues-in-2.20.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- `DCL40-C`, `RULE-8-4`: `IncompatibleFunctionDeclarations.ql`, `CompatibleDeclarationFunctionDefined.ql`.
- Fixed performance issues introduced when upgrading to CodeQL `2.20.7` by removing unnecessary check that matching function declarations have matching names.
- `RULE-7-5`: `IncorrectlySizedIntegerConstantMacroArgument.ql`.
- Added a `bindingset` to improve performance when checking if a literal matches the size of an integer constant macro.
20 changes: 10 additions & 10 deletions cpp/autosar/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 2.1.1
version: 4.0.3
codeql/dataflow:
version: 1.1.6
version: 2.0.3
codeql/mad:
version: 1.0.12
version: 1.0.19
codeql/rangeanalysis:
version: 1.0.12
version: 1.0.19
codeql/ssa:
version: 1.0.12
version: 1.0.19
codeql/tutorial:
version: 1.0.12
version: 1.0.19
codeql/typeflow:
version: 1.0.12
version: 1.0.19
codeql/typetracking:
version: 1.0.12
version: 2.0.3
codeql/util:
version: 1.0.12
version: 2.0.6
codeql/xml:
version: 1.0.12
version: 1.0.19
compiled: false
2 changes: 1 addition & 1 deletion cpp/autosar/src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ suites: codeql-suites
license: MIT
dependencies:
codeql/common-cpp-coding-standards: '*'
codeql/cpp-all: 2.1.1
codeql/cpp-all: 4.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import codingstandards.cpp.FunctionEquivalence

class Candidate extends TemplateFunction {
Candidate() {
this.getAParameter().getType().(RValueReferenceType).getBaseType() instanceof TemplateParameter
this.getAParameter().getType().(RValueReferenceType).getBaseType() instanceof
TypeTemplateParameter
}
}

Expand Down
Loading
Loading