Skip to content

Commit f5cae9b

Browse files
authored
Merge pull request #1881 from aschackmull/java/pathgraph-nodes
Java/C++/C#: Add nodes predicate to PathGraph.
2 parents e8cf3f8 + 6299625 commit f5cae9b

File tree

80 files changed

+2067
-445
lines changed

Some content is hidden

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

80 files changed

+2067
-445
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ abstract private class AccessPath extends TAccessPath {
12601260

12611261
private class AccessPathNil extends AccessPath, TNil {
12621262
override string toString() {
1263-
exists(DataFlowType t | this = TNil(t) | result = concat(ppReprType(t)))
1263+
exists(DataFlowType t | this = TNil(t) | result = concat(" : " + ppReprType(t)))
12641264
}
12651265

12661266
override AccessPathFront getFront() {
@@ -1647,6 +1647,11 @@ private predicate pathSuccPlus(PathNode n1, PathNode n2) = fastTC(pathSucc/2)(n1
16471647
module PathGraph {
16481648
/** Holds if `(a,b)` is an edge in the graph of data flow path explanations. */
16491649
query predicate edges(PathNode a, PathNode b) { pathSucc(a, b) }
1650+
1651+
/** Holds if `n` is a node in the graph of data flow path explanations. */
1652+
query predicate nodes(PathNode n, string key, string val) {
1653+
reach(n) and key = "semmle.label" and val = n.toString()
1654+
}
16501655
}
16511656

16521657
/**

0 commit comments

Comments
 (0)