Skip to content

Commit a59f0d3

Browse files
committed
run the implicit-this patch on QL-for-QL
1 parent 3a4f029 commit a59f0d3

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ class Import extends TImport, ModuleMember, TypeRef {
11671167
*/
11681168
string getImportString() {
11691169
exists(string selec |
1170-
not exists(getSelectionName(_)) and selec = ""
1170+
not exists(this.getSelectionName(_)) and selec = ""
11711171
or
11721172
selec =
11731173
"::" + strictconcat(int i, string q | q = this.getSelectionName(i) | q, "::" order by i)

ql/ql/src/codeql_ql/dataflow/DataFlow.qll

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class SuperNode extends LocalFlow::TSuperNode {
204204
Node getANode() { LocalFlow::getRepr(result) = repr }
205205

206206
/** Gets an AST node from any of the nodes in this super node. */
207-
AstNode asAstNode() { result = getANode().asAstNode() }
207+
AstNode asAstNode() { result = this.getANode().asAstNode() }
208208

209209
/**
210210
* Gets a single node from this super node.
@@ -214,23 +214,25 @@ class SuperNode extends LocalFlow::TSuperNode {
214214
* - An `AstNodeNode` is preferred over other nodes.
215215
* - A node occurring earlier is preferred over one occurring later.
216216
*/
217-
Node getArbitraryRepr() { result = min(Node n | n = getANode() | n order by getInternalId(n)) }
217+
Node getArbitraryRepr() {
218+
result = min(Node n | n = this.getANode() | n order by getInternalId(n))
219+
}
218220

219221
/**
220222
* Gets the predicate containing all nodes that are part of this super node.
221223
*/
222-
Predicate getEnclosingPredicate() { result = getANode().getEnclosingPredicate() }
224+
Predicate getEnclosingPredicate() { result = this.getANode().getEnclosingPredicate() }
223225

224226
/** Gets a string representation of this super node. */
225227
string toString() {
226228
exists(int c |
227-
c = strictcount(getANode()) and
228-
result = "Super node of " + c + " nodes in " + getEnclosingPredicate().getName()
229+
c = strictcount(this.getANode()) and
230+
result = "Super node of " + c + " nodes in " + this.getEnclosingPredicate().getName()
229231
)
230232
}
231233

232234
/** Gets the location of an arbitrary node in this super node. */
233-
Location getLocation() { result = getArbitraryRepr().getLocation() }
235+
Location getLocation() { result = this.getArbitraryRepr().getLocation() }
234236

235237
/** Gets any member call whose receiver is in the same super node. */
236238
MemberCall getALocalMemberCall() { superNode(result.getBase()) = this }
@@ -287,7 +289,7 @@ class SuperNode extends LocalFlow::TSuperNode {
287289
cached
288290
private string getAStringValue(Tracker t) {
289291
t.start() and
290-
result = asAstNode().(String).getValue()
292+
result = this.asAstNode().(String).getValue()
291293
or
292294
exists(SuperNode pred, Tracker t2 |
293295
this = pred.track(t2, t) and

ql/ql/src/queries/reports/FrameworkCoverage.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ class PackageImportCall extends PredicateCall {
1818
PackageImportCall() {
1919
this.getQualifier().getName() = ["API", "DataFlow"] and
2020
this.getPredicateName() = ["moduleImport", "moduleMember"] and
21-
not isExcludedFile(getLocation().getFile())
21+
not isExcludedFile(this.getLocation().getFile())
2222
}
2323

2424
/** Gets the name of a package referenced by this call */
25-
string getAPackageName() { result = DataFlow::superNode(getArgument(0)).getAStringValueNoCall() }
25+
string getAPackageName() {
26+
result = DataFlow::superNode(this.getArgument(0)).getAStringValueNoCall()
27+
}
2628
}
2729

2830
/** Gets a reference to `package` or any transitive member thereof. */

0 commit comments

Comments
 (0)