Skip to content

Commit 5888325

Browse files
authored
Merge branch 'main' into patch-1
2 parents 13fae22 + e03646a commit 5888325

File tree

89 files changed

+1182
-365
lines changed

Some content is hidden

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

89 files changed

+1182
-365
lines changed

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
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.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)