Skip to content

Commit ea67ca2

Browse files
committed
C++: Undo changes to shared dataflow files.
1 parent fe89174 commit ea67ca2

File tree

9 files changed

+63
-81
lines changed

9 files changed

+63
-81
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ abstract class Configuration extends string {
110110
/**
111111
* Holds if data may flow from some source to `sink` for this configuration.
112112
*/
113-
predicate hasFlowTo(Node sink) { this.hasFlow(_, sink) }
113+
predicate hasFlowTo(Node sink) { hasFlow(_, sink) }
114114

115115
/**
116116
* Holds if data may flow from some source to `sink` for this configuration.
117117
*/
118-
predicate hasFlowToExpr(DataFlowExpr sink) { this.hasFlowTo(exprNode(sink)) }
118+
predicate hasFlowToExpr(DataFlowExpr sink) { hasFlowTo(exprNode(sink)) }
119119

120120
/**
121121
* Gets the exploration limit for `hasPartialFlow` and `hasPartialFlowRev`
@@ -3170,7 +3170,7 @@ private class AccessPathCons extends AccessPath, TAccessPathCons {
31703170
}
31713171

31723172
override string toString() {
3173-
result = "[" + this.toStringImpl(true) + this.length().toString() + ")]"
3173+
result = "[" + this.toStringImpl(true) + length().toString() + ")]"
31743174
or
31753175
result = "[" + this.toStringImpl(false)
31763176
}
@@ -3309,11 +3309,9 @@ abstract private class PathNodeImpl extends PathNode {
33093309
result = " <" + this.(PathNodeMid).getCallContext().toString() + ">"
33103310
}
33113311

3312-
override string toString() { result = this.getNodeEx().toString() + this.ppAp() }
3312+
override string toString() { result = this.getNodeEx().toString() + ppAp() }
33133313

3314-
override string toStringWithContext() {
3315-
result = this.getNodeEx().toString() + this.ppAp() + this.ppCtx()
3316-
}
3314+
override string toStringWithContext() { result = this.getNodeEx().toString() + ppAp() + ppCtx() }
33173315

33183316
override predicate hasLocationInfo(
33193317
string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -3381,11 +3379,11 @@ private class PathNodeMid extends PathNodeImpl, TPathNodeMid {
33813379

33823380
override PathNodeImpl getASuccessorImpl() {
33833381
// an intermediate step to another intermediate node
3384-
result = this.getSuccMid()
3382+
result = getSuccMid()
33853383
or
33863384
// a final step to a sink via zero steps means we merge the last two steps to prevent trivial-looking edges
33873385
exists(PathNodeMid mid, PathNodeSink sink |
3388-
mid = this.getSuccMid() and
3386+
mid = getSuccMid() and
33893387
mid.getNodeEx() = sink.getNodeEx() and
33903388
mid.getAp() instanceof AccessPathNil and
33913389
sink.getConfiguration() = unbindConf(mid.getConfiguration()) and

0 commit comments

Comments
 (0)