Skip to content

Commit 2b5af15

Browse files
committed
comments about what we resolve, and remove a debug comment
1 parent 96eacd0 commit 2b5af15

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ql/ql/src/codeql_ql/ast/internal/Module.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class Module_ extends FileOrModule, TModule {
114114
}
115115
}
116116

117-
// class ModuleRef = AstNodes::TModuleExpr or AstNodes::TType;
118117
private predicate resolveQualifiedName(Import imp, ContainerOrModule m, int i) {
119118
not m = TFile(any(File f | f.getExtension() = "ql")) and
120119
exists(string q | q = imp.getQualifiedName(i) |
@@ -264,8 +263,10 @@ private predicate definesModule(
264263
public = false and
265264
ty = sig.asModuleRef()
266265
|
266+
// resolve to the signature module
267267
m = ty.getResolvedModule()
268268
or
269+
// resolve to the arguments of the instantiated module
269270
exists(ModuleExpr inst | inst.getResolvedModule().asModule() = mod |
270271
m = inst.getArgument(i).asModuleRef().getResolvedModule()
271272
)

ql/ql/src/codeql_ql/ast/internal/Predicate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ private module Cached {
7474
mod.hasParameter(i, pc.getPredicateName(), sig) and
7575
sig.getArity() = pc.getNumberOfArguments()
7676
|
77+
// resolve to the signature predicate
7778
p = sig.getResolvedPredicate() // <- this is a `signature predicate`, but that's fine.
7879
or
80+
// resolve to the instantiations
7981
exists(ModuleExpr inst, SignatureExpr arg | inst.getResolvedModule().asModule() = mod |
8082
arg = inst.getArgument(i) and
8183
p = arg.asPredicate().getResolvedPredicate()

ql/ql/src/codeql_ql/ast/internal/Type.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ private predicate defines(FileOrModule m, string name, Type t, boolean public) {
330330
mod.hasParameter(i, name, param) and
331331
public = true
332332
|
333-
// we resolve it both to the signature type
333+
// resolve to the signature class
334334
t = param.asType().getResolvedType()
335335
or
336-
// or any instantiated type
336+
// resolve to the instantiations
337337
exists(ModuleExpr inst, SignatureExpr arg |
338338
inst.getArgument(i) = arg and
339339
inst.getResolvedModule() = m and

0 commit comments

Comments
 (0)