Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1501a40

Browse files
committed
Dataflow: Count callables instead of nodes for fieldFlowBranchLimit.
1 parent 6aae51f commit 1501a40

21 files changed

Lines changed: 252 additions & 84 deletions

File tree

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,12 @@ private predicate flowIntoCallNodeCand1(
649649
*/
650650
private int branch(Node n1, Configuration conf) {
651651
result =
652-
strictcount(Node n |
653-
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
652+
strictcount(DataFlowCallable callable |
653+
exists(Node n |
654+
flowOutOfCallNodeCand1(_, n1, n, conf) or flowIntoCallNodeCand1(_, n1, n, conf)
655+
|
656+
callable = n.getEnclosingCallable()
657+
)
654658
)
655659
}
656660

@@ -661,8 +665,12 @@ private int branch(Node n1, Configuration conf) {
661665
*/
662666
private int join(Node n2, Configuration conf) {
663667
result =
664-
strictcount(Node n |
665-
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
668+
strictcount(DataFlowCallable callable |
669+
exists(Node n |
670+
flowOutOfCallNodeCand1(_, n, n2, conf) or flowIntoCallNodeCand1(_, n, n2, conf)
671+
|
672+
callable = n.getEnclosingCallable()
673+
)
666674
)
667675
}
668676

0 commit comments

Comments
 (0)