Skip to content

Commit 5db2f9a

Browse files
committed
Merge remote-tracking branch 'origin/main' into nickrolfe/pathname
2 parents c1302a9 + 8988a02 commit 5db2f9a

File tree

280 files changed

+2157
-804
lines changed

Some content is hidden

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

280 files changed

+2157
-804
lines changed

cpp/ql/lib/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.3.0
2+
3+
### Deprecated APIs
4+
5+
* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module.
6+
7+
### Bug Fixes
8+
9+
* `UserType.getADeclarationEntry()` now yields all forward declarations when the user type is a `class`, `struct`, or `union`.
10+
111
## 0.2.3
212

313
### New Features

cpp/ql/lib/change-notes/2022-05-30-braced-initializers.md

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

cpp/ql/lib/change-notes/2022-06-22-class-declaration-entry-fix.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## 0.3.0
2+
3+
### Deprecated APIs
4+
5+
* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module.
6+
7+
### Bug Fixes
8+
9+
* `UserType.getADeclarationEntry()` now yields all forward declarations when the user type is a `class`, `struct`, or `union`.

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.2.3
2+
lastReleaseVersion: 0.3.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.3.0-dev
2+
version: 0.3.1-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config
428428
exists(Node n1, Node n2 |
429429
node1.asNode() = n1 and
430430
node2.asNode() = n2 and
431-
simpleLocalFlowStepExt(n1, n2) and
431+
simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
432432
stepFilter(node1, node2, config)
433433
)
434434
or
@@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat
447447
exists(Node n1, Node n2 |
448448
node1.asNode() = n1 and
449449
node2.asNode() = n2 and
450-
config.isAdditionalFlowStep(n1, n2) and
450+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
451451
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
452452
stepFilter(node1, node2, config)
453453
)
@@ -466,7 +466,7 @@ private predicate additionalLocalStateStep(
466466
exists(Node n1, Node n2 |
467467
node1.asNode() = n1 and
468468
node2.asNode() = n2 and
469-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
469+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
470470
getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and
471471
stepFilter(node1, node2, config) and
472472
not stateBarrier(node1, s1, config) and
@@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) {
481481
exists(Node n1, Node n2 |
482482
node1.asNode() = n1 and
483483
node2.asNode() = n2 and
484-
jumpStepCached(n1, n2) and
484+
jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
485485
stepFilter(node1, node2, config) and
486486
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
487487
)
@@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c
494494
exists(Node n1, Node n2 |
495495
node1.asNode() = n1 and
496496
node2.asNode() = n2 and
497-
config.isAdditionalFlowStep(n1, n2) and
497+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and
498498
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
499499
stepFilter(node1, node2, config) and
500500
not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext
@@ -507,7 +507,7 @@ private predicate additionalJumpStateStep(
507507
exists(Node n1, Node n2 |
508508
node1.asNode() = n1 and
509509
node2.asNode() = n2 and
510-
config.isAdditionalFlowStep(n1, s1, n2, s2) and
510+
config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and
511511
getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and
512512
stepFilter(node1, node2, config) and
513513
not stateBarrier(node1, s1, config) and
@@ -518,7 +518,7 @@ private predicate additionalJumpStateStep(
518518

519519
pragma[nomagic]
520520
private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) {
521-
readSet(node1.asNode(), c, node2.asNode()) and
521+
readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and
522522
stepFilter(node1, node2, config)
523523
or
524524
exists(Node n |
@@ -562,7 +562,8 @@ pragma[nomagic]
562562
private predicate store(
563563
NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config
564564
) {
565-
store(node1.asNode(), tc, node2.asNode(), contentType) and
565+
store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()),
566+
contentType) and
566567
read(_, tc.getContent(), _, config) and
567568
stepFilter(node1, node2, config)
568569
}

0 commit comments

Comments
 (0)