Skip to content

Commit 75e6fd9

Browse files
authored
Merge pull request github#13918 from github/post-release-prep/codeql-cli-2.14.2
Post-release preparation for codeql-cli-2.14.2
2 parents e39fb09 + 1213eba commit 75e6fd9

File tree

141 files changed

+423
-418
lines changed

Some content is hidden

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

141 files changed

+423
-418
lines changed

cpp/ql/lib/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 0.9.0
2+
3+
### Breaking Changes
4+
5+
* The `shouldPrintFunction` predicate from `PrintAstConfiguration` has been replaced by `shouldPrintDeclaration`. Users should now override `shouldPrintDeclaration` if they want to limit the declarations that should be printed.
6+
* The `shouldPrintFunction` predicate from `PrintIRConfiguration` has been replaced by `shouldPrintDeclaration`. Users should now override `shouldPrintDeclaration` if they want to limit the declarations that should be printed.
7+
8+
### Major Analysis Improvements
9+
10+
* The `PrintAST` library now also prints global and namespace variables and their initializers.
11+
12+
### Minor Analysis Improvements
13+
14+
* The `_Float128x` type is no longer exposed as a builtin type. As this type could not occur any code base, this should only affect queries that explicitly looked at the builtin types.
15+
116
## 0.8.1
217

318
### Deprecated APIs

cpp/ql/lib/change-notes/2023-07-20-print-global-variables.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

cpp/ql/lib/change-notes/2023-08-07-removal-of-float128x.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
---
2-
category: breaking
3-
---
1+
## 0.9.0
2+
3+
### Breaking Changes
4+
45
* The `shouldPrintFunction` predicate from `PrintAstConfiguration` has been replaced by `shouldPrintDeclaration`. Users should now override `shouldPrintDeclaration` if they want to limit the declarations that should be printed.
56
* The `shouldPrintFunction` predicate from `PrintIRConfiguration` has been replaced by `shouldPrintDeclaration`. Users should now override `shouldPrintDeclaration` if they want to limit the declarations that should be printed.
7+
8+
### Major Analysis Improvements
9+
10+
* The `PrintAST` library now also prints global and namespace variables and their initializers.
11+
12+
### Minor Analysis Improvements
13+
14+
* The `_Float128x` type is no longer exposed as a builtin type. As this type could not occur any code base, this should only affect queries that explicitly looked at the builtin types.

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: 0.8.1
2+
lastReleaseVersion: 0.9.0

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: 0.8.2-dev
2+
version: 0.9.1-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/SemanticExpr.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,3 @@ class SemConditionalExpr extends SemKnownExpr {
307307
branch = false and result = falseResult
308308
}
309309
}
310-
311-
/** Holds if `upper = true` and `e <= bound` or `upper = false` and `e >= bound`. */
312-
predicate semHasConstantBoundConstantSpecific(SemExpr e, float bound, boolean upper) {
313-
Specific::hasConstantBoundConstantSpecific(e, bound, upper)
314-
}

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/SemanticExprSpecific.qll

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -434,50 +434,6 @@ module SemanticExprConfig {
434434

435435
/** Gets the expression associated with `instr`. */
436436
SemExpr getSemanticExpr(IR::Instruction instr) { result = Equiv::getEquivalenceClass(instr) }
437-
438-
private predicate typeBounds(SemType t, float lb, float ub) {
439-
exists(SemIntegerType integralType, float limit |
440-
integralType = t and limit = 2.pow(8 * integralType.getByteSize())
441-
|
442-
if integralType instanceof SemBooleanType
443-
then lb = 0 and ub = 1
444-
else
445-
if integralType.isSigned()
446-
then (
447-
lb = -(limit / 2) and ub = (limit / 2) - 1
448-
) else (
449-
lb = 0 and ub = limit - 1
450-
)
451-
)
452-
or
453-
// This covers all floating point types. The range is (-Inf, +Inf).
454-
t instanceof SemFloatingPointType and lb = -(1.0 / 0.0) and ub = 1.0 / 0.0
455-
}
456-
457-
/**
458-
* Holds if `upper = true` and `e <= bound` or `upper = false` and `e >= bound` based
459-
* only on type information.
460-
*/
461-
predicate hasConstantBoundConstantSpecific(Expr e, float bound, boolean upper) {
462-
exists(
463-
SemType converted, SemType unconverted, float unconvertedLb, float convertedLb,
464-
float unconvertedUb, float convertedUb
465-
|
466-
unconverted = getSemanticType(e.getUnconverted().getResultIRType()) and
467-
converted = getSemanticType(e.getConverted().getResultIRType()) and
468-
typeBounds(unconverted, unconvertedLb, unconvertedUb) and
469-
typeBounds(converted, convertedLb, convertedUb) and
470-
(
471-
upper = true and
472-
unconvertedUb < convertedUb and
473-
bound = unconvertedUb
474-
or
475-
upper = false and
476-
unconvertedLb > convertedLb and
477-
bound = unconvertedLb
478-
)
479-
)
480-
}
481437
}
482438

483439
predicate getSemanticExpr = SemanticExprConfig::getSemanticExpr/1;
@@ -501,5 +457,3 @@ IRBound::Bound getCppBound(SemBound bound) { bound = result }
501457
SemGuard getSemanticGuard(IRGuards::IRGuardCondition guard) { result = guard }
502458

503459
IRGuards::IRGuardCondition getCppGuard(SemGuard guard) { guard = result }
504-
505-
predicate hasConstantBoundConstantSpecific = SemanticExprConfig::hasConstantBoundConstantSpecific/3;

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/RangeAnalysisConstantSpecific.qll

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,10 @@
33
*/
44

55
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
6-
private import codeql.util.Unit
7-
private import Reason as Reason
86
private import RangeAnalysisStage
97
private import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.FloatDelta
108

119
module CppLangImplConstant implements LangSig<FloatDelta> {
12-
private module Param implements Reason::ParamSig {
13-
class TypeReasonImpl = Unit;
14-
}
15-
16-
class SemReason = Reason::Make<Param>::SemReason;
17-
18-
class SemNoReason = Reason::Make<Param>::SemNoReason;
19-
20-
class SemCondReason = Reason::Make<Param>::SemCondReason;
21-
22-
class SemTypeReason = Reason::Make<Param>::SemTypeReason;
23-
2410
/**
2511
* Holds if the specified expression should be excluded from the result of `ssaRead()`.
2612
*
@@ -74,10 +60,7 @@ module CppLangImplConstant implements LangSig<FloatDelta> {
7460
/**
7561
* Holds if `e >= bound` (if `upper = false`) or `e <= bound` (if `upper = true`).
7662
*/
77-
predicate hasConstantBound(SemExpr e, float bound, boolean upper, SemReason reason) {
78-
semHasConstantBoundConstantSpecific(e, bound, upper) and
79-
reason instanceof SemTypeReason
80-
}
63+
predicate hasConstantBound(SemExpr e, float bound, boolean upper) { none() }
8164

8265
/**
8366
* Holds if `e >= bound + delta` (if `upper = false`) or `e <= bound + delta` (if `upper = true`).

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/RangeAnalysisImpl.qll

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,18 @@ private newtype TSemReason =
6161
guard = any(ConstantStage::SemCondReason reason).getCond()
6262
or
6363
guard = any(RelativeStage::SemCondReason reason).getCond()
64-
} or
65-
TSemTypeReason()
64+
}
6665

67-
private ConstantStage::SemReason constantReason(SemReason reason) {
66+
ConstantStage::SemReason constantReason(SemReason reason) {
6867
result instanceof ConstantStage::SemNoReason and reason instanceof SemNoReason
6968
or
7069
result.(ConstantStage::SemCondReason).getCond() = reason.(SemCondReason).getCond()
71-
or
72-
result instanceof ConstantStage::SemTypeReason and reason instanceof SemTypeReason
7370
}
7471

75-
private RelativeStage::SemReason relativeReason(SemReason reason) {
72+
RelativeStage::SemReason relativeReason(SemReason reason) {
7673
result instanceof RelativeStage::SemNoReason and reason instanceof SemNoReason
7774
or
7875
result.(RelativeStage::SemCondReason).getCond() = reason.(SemCondReason).getCond()
79-
or
80-
result instanceof RelativeStage::SemTypeReason and reason instanceof SemTypeReason
8176
}
8277

8378
import Public
@@ -116,12 +111,4 @@ module Public {
116111

117112
override string toString() { result = this.getCond().toString() }
118113
}
119-
120-
/**
121-
* A reason for an inferred bound that indicates that the bound is inferred
122-
* based on type-information.
123-
*/
124-
class SemTypeReason extends SemReason, TSemTypeReason {
125-
override string toString() { result = "TypeReason" }
126-
}
127114
}

0 commit comments

Comments
 (0)