mirror of
https://github.com/github/codeql.git
synced 2026-02-08 03:01:10 +01:00
correctly resolve super calls in char preds
This commit is contained in:
@@ -81,7 +81,7 @@ private module Cached {
|
||||
// super calls
|
||||
exists(Super sup, ClassType type, Type supertype |
|
||||
mc.getBase() = sup and
|
||||
sup.getEnclosingPredicate().(ClassPredicate).getParent().getType() = type and
|
||||
sup.getEnclosingPredicate().getParent().(Class).getType() = type and
|
||||
supertype in [type.getASuperType(), type.getAnInstanceofType()] and
|
||||
p = supertype.getClassPredicate(mc.getMemberName(), mc.getNumberOfArguments())
|
||||
)
|
||||
|
||||
11
ql/test/callgraph/Baz.qll
Normal file
11
ql/test/callgraph/Baz.qll
Normal file
@@ -0,0 +1,11 @@
|
||||
class Foo extends string {
|
||||
Foo() { this = "Foo" }
|
||||
|
||||
string getImportedPath() { none() }
|
||||
}
|
||||
|
||||
class Bar extends string, Foo {
|
||||
Bar() { exists(Foo.super.getImportedPath()) }
|
||||
|
||||
override string getImportedPath() { none() }
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
getTarget
|
||||
| Bar.qll:5:38:5:47 | PredicateCall | Bar.qll:8:3:8:31 | ClasslessPredicate snapshot |
|
||||
| Baz.qll:8:18:8:44 | MemberCall | Baz.qll:4:3:4:37 | ClassPredicate getImportedPath |
|
||||
| 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