Skip to content

Commit 237669a

Browse files
committed
Merge branch 'main' into dbsinks2
2 parents 725d784 + 5792b4d commit 237669a

File tree

1,457 files changed

+33632
-12530
lines changed

Some content is hidden

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

1,457 files changed

+33632
-12530
lines changed

.git-blame-ignore-revs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .git-blame-ignore-revs
2+
# Auto-formatted Java
3+
730eae952139209fe9fdf598541d608f4c0c0c84
4+
# Auto-formatted C#
5+
5ad7ed49dd3de03ec6dcfcb6848758a6a987e11c
6+
# Auto-formatted C/C++
7+
ef97e539ec1971494d4bba5cafe82e00bc8217ac
8+
# Auto-formatted Python
9+
21d5fa836b3a7d020ba45e8b8168b145a9772131
10+
# Auto-formatted JavaScript
11+
8d97fe9ed327a9546ff2eaf515cf0f5214deddd9
12+
# Auto-formatted Ruby
13+
a5d229903d2f12d45f2c2c38822f1d0e7504ae7f
14+
# Auto-formatted Go
15+
08c658e66bf867090033ea096e244a93d46c0aa7
16+
# Auto-formatted Swift
17+
711d7057f79fb7d72fc3b35e010bd018f9009169
18+
# Auto-formatted shared ql packs
19+
3640b6d3a8ce9edf8e1d3ed106fe8526cf255bc0
20+
# Auto-formatted taint tracking files
21+
159d8e978c51959b380838c080d891b66e763b19

CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/csharp/ @github/codeql-csharp
33
/go/ @github/codeql-go
44
/java/ @github/codeql-java
5-
/javascript/ @github/codeql-dynamic
6-
/python/ @github/codeql-dynamic
7-
/ruby/ @github/codeql-dynamic
5+
/javascript/ @github/codeql-javascript
6+
/python/ @github/codeql-python
7+
/ruby/ @github/codeql-ruby
88
/swift/ @github/codeql-swift
99
/misc/codegen/ @github/codeql-swift
1010
/java/kotlin-extractor/ @github/codeql-kotlin

cpp/ql/lib/CHANGELOG.md

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

37
No user-facing changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Deleted the deprecated `hasGeneratedCopyConstructor` and `hasGeneratedCopyAssignmentOperator` predicates from the `Folder` class.
5+
* Deleted the deprecated `getPath` and `getFolder` predicates from the `XmlFile` class.
6+
* Deleted the deprecated `getMustlockFunction`, `getTrylockFunction`, `getLockFunction`, and `getUnlockFunction` predicates from the `MutexType` class.
7+
* Deleted the deprecated `getPosInBasicBlock` predicate from the `SubBasicBlock` class.
8+
* Deleted the deprecated `getExpr` predicate from the `PointerDereferenceExpr` class.
9+
* Deleted the deprecated `getUseInstruction` and `getDefinitionInstruction` predicates from the `Operand` class.
10+
* Deleted the deprecated `isInParameter`, `isInParameterPointer`, and `isInQualifier` predicates from the `FunctionInput` class.
11+
* Deleted the deprecated `isOutParameterPointer`, `isOutQualifier`, `isOutReturnValue`, and `isOutReturnPointer` predicate from the `FunctionOutput` class.
12+
* Deleted the deprecated 3-argument `isGuardPhi` predicate from the `RangeSsaDefinition` class.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* Added support for merging two `PathGraph`s via disjoint union to allow results from multiple data flow computations in a single `path-problem` query.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.5.4
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: 0.5.3
2+
lastReleaseVersion: 0.5.4

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlow.qll

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,111 @@ module MakeWithState<StateConfigSig Config> implements DataFlowSig {
243243

244244
import Impl<C>
245245
}
246+
247+
signature class PathNodeSig {
248+
/** Gets a textual representation of this element. */
249+
string toString();
250+
251+
/**
252+
* Holds if this element is at the specified location.
253+
* The location spans column `startcolumn` of line `startline` to
254+
* column `endcolumn` of line `endline` in file `filepath`.
255+
* For more information, see
256+
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
257+
*/
258+
predicate hasLocationInfo(
259+
string filepath, int startline, int startcolumn, int endline, int endcolumn
260+
);
261+
262+
/** Gets the underlying `Node`. */
263+
Node getNode();
264+
}
265+
266+
signature module PathGraphSig<PathNodeSig PathNode> {
267+
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
268+
predicate edges(PathNode a, PathNode b);
269+
270+
/** Holds if `n` is a node in the graph of data flow path explanations. */
271+
predicate nodes(PathNode n, string key, string val);
272+
273+
/**
274+
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
275+
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
276+
* `ret -> out` is summarized as the edge `arg -> out`.
277+
*/
278+
predicate subpaths(PathNode arg, PathNode par, PathNode ret, PathNode out);
279+
}
280+
281+
/**
282+
* Constructs a `PathGraph` from two `PathGraph`s by disjoint union.
283+
*/
284+
module MergePathGraph<
285+
PathNodeSig PathNode1, PathNodeSig PathNode2, PathGraphSig<PathNode1> Graph1,
286+
PathGraphSig<PathNode2> Graph2>
287+
{
288+
private newtype TPathNode =
289+
TPathNode1(PathNode1 p) or
290+
TPathNode2(PathNode2 p)
291+
292+
/** A node in a graph of path explanations that is formed by disjoint union of the two given graphs. */
293+
class PathNode extends TPathNode {
294+
/** Gets this as a projection on the first given `PathGraph`. */
295+
PathNode1 asPathNode1() { this = TPathNode1(result) }
296+
297+
/** Gets this as a projection on the second given `PathGraph`. */
298+
PathNode2 asPathNode2() { this = TPathNode2(result) }
299+
300+
/** Gets a textual representation of this element. */
301+
string toString() {
302+
result = this.asPathNode1().toString() or
303+
result = this.asPathNode2().toString()
304+
}
305+
306+
/**
307+
* Holds if this element is at the specified location.
308+
* The location spans column `startcolumn` of line `startline` to
309+
* column `endcolumn` of line `endline` in file `filepath`.
310+
* For more information, see
311+
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
312+
*/
313+
predicate hasLocationInfo(
314+
string filepath, int startline, int startcolumn, int endline, int endcolumn
315+
) {
316+
this.asPathNode1().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) or
317+
this.asPathNode2().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
318+
}
319+
320+
/** Gets the underlying `Node`. */
321+
Node getNode() {
322+
result = this.asPathNode1().getNode() or
323+
result = this.asPathNode2().getNode()
324+
}
325+
}
326+
327+
/**
328+
* Provides the query predicates needed to include a graph in a path-problem query.
329+
*/
330+
module PathGraph implements PathGraphSig<PathNode> {
331+
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
332+
query predicate edges(PathNode a, PathNode b) {
333+
Graph1::edges(a.asPathNode1(), b.asPathNode1()) or
334+
Graph2::edges(a.asPathNode2(), b.asPathNode2())
335+
}
336+
337+
/** Holds if `n` is a node in the graph of data flow path explanations. */
338+
query predicate nodes(PathNode n, string key, string val) {
339+
Graph1::nodes(n.asPathNode1(), key, val) or
340+
Graph2::nodes(n.asPathNode2(), key, val)
341+
}
342+
343+
/**
344+
* Holds if `(arg, par, ret, out)` forms a subpath-tuple, that is, flow through
345+
* a subpath between `par` and `ret` with the connecting edges `arg -> par` and
346+
* `ret -> out` is summarized as the edge `arg -> out`.
347+
*/
348+
query predicate subpaths(PathNode arg, PathNode par, PathNode ret, PathNode out) {
349+
Graph1::subpaths(arg.asPathNode1(), par.asPathNode1(), ret.asPathNode1(), out.asPathNode1()) or
350+
Graph2::subpaths(arg.asPathNode2(), par.asPathNode2(), ret.asPathNode2(), out.asPathNode2())
351+
}
352+
}
353+
}

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ module Impl<FullStateConfigSig Config> {
456456
* The Boolean `cc` records whether the node is reached through an
457457
* argument in a call.
458458
*/
459+
pragma[assume_small_delta]
459460
private predicate fwdFlow(NodeEx node, Cc cc) {
460461
sourceNode(node, _) and
461462
if hasSourceCallCtx() then cc = true else cc = false
@@ -3156,7 +3157,7 @@ module Impl<FullStateConfigSig Config> {
31563157
/**
31573158
* Provides the query predicates needed to include a graph in a path-problem query.
31583159
*/
3159-
module PathGraph {
3160+
module PathGraph implements PathGraphSig<PathNode> {
31603161
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
31613162
query predicate edges(PathNode a, PathNode b) { a.getASuccessor() = b }
31623163

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/tainttracking1/TaintTracking.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import TaintTrackingParameter::Public
77
private import TaintTrackingParameter::Private
88

99
private module AddTaintDefaults<DataFlowInternal::FullStateConfigSig Config> implements
10-
DataFlowInternal::FullStateConfigSig {
10+
DataFlowInternal::FullStateConfigSig
11+
{
1112
import Config
1213

1314
predicate isBarrier(DataFlow::Node node) {

0 commit comments

Comments
 (0)