Skip to content

Commit e508201

Browse files
committed
Address review comment
1 parent 8b27e89 commit e508201

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/LocalNameBinding.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ private class IdentifierPotentialLocalNameAccess extends PotentialLocalNameAcces
513513
}
514514

515515
private class SuperPotentialLocalNameAccess extends PotentialLocalNameAccessImpl, SuperExpr {
516-
override string getName() { result = any(NameBindingPlugin p).getSuperLocalName() }
516+
override string getName() { result = any(NameBindingPlugin p).getSuperLocalName(this) }
517517
}
518518

519519
/** Gets the implicitly-declared variable through which the given callable refers to its receiver. */

‎unified/ql/lib/codeql/unified/internal/NameBindingPlugin.qll‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ class NameBindingPlugin extends Unit {
6969
string getImplicitReceiverParameterName(Callable callable) { none() }
7070

7171
/**
72-
* Gets the name to be used when resolving `super` expressions, for example
73-
* `this` or `self`.
72+
* Gets the name to be used when resolving `super`, for example `this` or `self`.
7473
*/
75-
string getSuperLocalName() { none() }
74+
bindingset[se]
75+
string getSuperLocalName(SuperExpr se) { none() }
7676

7777
/**
7878
* Gets the name through which static members of the enclosing class `cls` can be

‎unified/ql/lib/codeql/unified/internal/NameBindingPluginSwift.qll‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ class NameBindingPluginSwift extends NameBindingPlugin {
107107
result = "self"
108108
}
109109

110-
override string getSuperLocalName() { result = "self" }
110+
bindingset[se]
111+
override string getSuperLocalName(SuperExpr se) { exists(se) and result = "self" }
111112

112113
bindingset[cls]
113114
override string getStaticSelfName(ClassLikeDeclaration cls) { exists(cls) and result = "Self" }

0 commit comments

Comments
 (0)