mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
QL: fix getEnclosingModule, which broke the callgraph
This commit is contained in:
@@ -154,18 +154,13 @@ private predicate resolveSelectionName(Import imp, ContainerOrModule m, int i) {
|
||||
|
||||
cached
|
||||
private module Cached {
|
||||
private Module getEnclosingModule0(AstNode n) {
|
||||
not n instanceof Module and
|
||||
(
|
||||
n = result.getAChild(_)
|
||||
or
|
||||
exists(AstNode prev |
|
||||
result = getEnclosingModule0(prev) and
|
||||
n = prev.getAChild(_)
|
||||
)
|
||||
)
|
||||
private AstNode parent(AstNode n) {
|
||||
result = n.getParent() and
|
||||
not n instanceof Module
|
||||
}
|
||||
|
||||
private Module getEnclosingModule0(AstNode n) { result = parent*(n.getParent()) }
|
||||
|
||||
cached
|
||||
ContainerOrModule getEnclosingModule(AstNode n) {
|
||||
result = TModule(getEnclosingModule0(n))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
getTarget
|
||||
| Bar.qll:5:38:5:47 | PredicateCall | Bar.qll:8:3:8:31 | ClasslessPredicate snapshot |
|
||||
| Foo.qll:5:26:5:30 | PredicateCall | Foo.qll:3:1:3:26 | ClasslessPredicate foo |
|
||||
| Foo.qll:10:21:10:25 | PredicateCall | Foo.qll:8:3:8:28 | ClassPredicate bar |
|
||||
| Foo.qll:14:30:14:40 | MemberCall | Foo.qll:10:3:10:27 | ClassPredicate baz |
|
||||
|
||||
Reference in New Issue
Block a user