Skip to content

Commit 45182c2

Browse files
authored
Merge branch 'main' into download-db-vs-code
2 parents c0b9be0 + 48761b8 commit 45182c2

File tree

158 files changed

+1717
-423
lines changed

Some content is hidden

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

158 files changed

+1717
-423
lines changed

cpp/ql/lib/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.3.4
2+
3+
### Deprecated APIs
4+
5+
* Many classes/predicates/modules with upper-case acronyms in their name have been renamed to follow our style-guide.
6+
The old name still exists as a deprecated alias.
7+
8+
### New Features
9+
10+
* Added support for getting the link targets of global and namespace variables.
11+
* Added a `BlockAssignExpr` class, which models a `memcpy`-like operation used in compiler generated copy/move constructors and assignment operations.
12+
13+
### Minor Analysis Improvements
14+
15+
* All deprecated predicates/classes/modules that have been deprecated for over a year have been deleted.
16+
117
## 0.3.3
218

319
### New Features

cpp/ql/lib/change-notes/2022-08-12-block-assignment-support.md

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

cpp/ql/lib/change-notes/2022-08-17-deleted-deprecations.md

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

cpp/ql/lib/change-notes/2022-08-22-link-targets-for-variables.md

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

cpp/ql/lib/change-notes/2022-08-22-xml-rename.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## 0.3.4
2+
3+
### Deprecated APIs
4+
5+
* Many classes/predicates/modules with upper-case acronyms in their name have been renamed to follow our style-guide.
6+
The old name still exists as a deprecated alias.
7+
8+
### New Features
9+
10+
* Added support for getting the link targets of global and namespace variables.
11+
* Added a `BlockAssignExpr` class, which models a `memcpy`-like operation used in compiler generated copy/move constructors and assignment operations.
12+
13+
### Minor Analysis Improvements
14+
15+
* All deprecated predicates/classes/modules that have been deprecated for over a year have been deleted.

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.3.3
2+
lastReleaseVersion: 0.3.4

cpp/ql/lib/experimental/semmle/code/cpp/semantic/analysis/SignAnalysisCommon.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ private class BinarySignExpr extends FlowSignExpr {
204204
}
205205
}
206206

207+
pragma[nomagic]
207208
private predicate binaryExprOperands(SemBinaryExpr binary, SemExpr left, SemExpr right) {
208209
binary.getLeftOperand() = left and binary.getRightOperand() = right
209210
}

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

cpp/ql/lib/semmle/code/cpp/commons/Scanf.qll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,28 @@ class ScanfFunctionCall extends FunctionCall {
143143
* (rather than a `char*`).
144144
*/
145145
predicate isWideCharDefault() { this.getScanfFunction().isWideCharDefault() }
146+
147+
/**
148+
* Gets the output argument at position `n` in the vararg list of this call.
149+
*
150+
* The range of `n` is from `0` to `this.getNumberOfOutputArguments() - 1`.
151+
*/
152+
Expr getOutputArgument(int n) {
153+
result = this.getArgument(this.getTarget().getNumberOfParameters() + n) and
154+
n >= 0
155+
}
156+
157+
/**
158+
* Gets an output argument given to this call in vararg position.
159+
*/
160+
Expr getAnOutputArgument() { result = this.getOutputArgument(_) }
161+
162+
/**
163+
* Gets the number of output arguments present in this call.
164+
*/
165+
int getNumberOfOutputArguments() {
166+
result = this.getNumberOfArguments() - this.getTarget().getNumberOfParameters()
167+
}
146168
}
147169

148170
/**

0 commit comments

Comments
 (0)