-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathMultiResolve.qll
More file actions
58 lines (43 loc) · 1.2 KB
/
MultiResolve.qll
File metadata and controls
58 lines (43 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
predicate foo(int a, int b) {
a = 2 and
b = 2
}
predicate foo(int a, int b, int c) {
a = 2 and
b = 2 and
c = 2
}
predicate myFoo = foo/2;
predicate test(int i) { myFoo(i, i) } // <- should only resolve to the `foo` with 2 arguments (and the `myFoo` alias).
module MyMod {
predicate bar() { any() }
class Bar extends int {
Bar() { this = 42 }
predicate bar() {
MyMod::bar() // <- should resolve to the module's predicate.
}
}
}
class Super1 extends int {
Super1() { this = 42 }
predicate foo() { any() }
}
class Super2 extends int {
Super2() { this = 42 }
predicate foo() { none() }
}
class Sub extends Super1, Super2 {
override predicate foo() { Super1.super.foo() } // <- should resolve to Super1::foo()
}
module Foo {
predicate foo() { any() }
}
predicate test() {
Foo::foo() // <- should resolve to `foo` from the module above, and not from the `Foo.qll` file.
}
class Sub2 extends Super1, Super2 {
override predicate foo() { Super2.super.foo() } // <- should resolve to Super2::foo()
predicate test() {
this.foo() // <- should resolve to only the above `foo` predicate, but currently it resolves to that, and all the overrides [INCONSISTENCY]
}
}