-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExercise10.ql
More file actions
61 lines (49 loc) · 1.65 KB
/
Exercise10.ql
File metadata and controls
61 lines (49 loc) · 1.65 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
59
60
61
import java
// Replace with the solution from exercise 1
class AllocationSite extends Expr {
AllocationSite() { none() }
}
predicate alloc(LocalScopeVariable variable, AllocationSite allocationSite, Callable callable) {
// Replace with the solution from exercise 2.
any()
}
predicate move(LocalScopeVariable dest, Variable src) {
// Exercise 3: Describe how a value in `src` is moved to `dest`
none()
}
predicate store(LocalScopeVariable qualifier, Field field, LocalScopeVariable src) {
// Replace with the solution from exercise 4.
any()
}
predicate load(LocalScopeVariable dest, LocalScopeVariable qualifier, Field field) {
// Replace with the solution from exercise 5.
any()
}
predicate fieldPointsTo(
AllocationSite qualifierAllocationSite, Field field, AllocationSite srcAllocationSite
) {
// Replace with the solution from exercise 6
any()
}
predicate varPointsTo(LocalScopeVariable variable, AllocationSite allocationSite) {
// Replace with solution from exercise 7.
any()
}
string getSignature(MethodAccess methodAccess) { result = methodAccess.getMethod().getSignature() }
predicate methodCall(
LocalScopeVariable qualifier, string signature, MethodAccess call, Method inMethod
) {
// Replace with solution from exercise 8.
any()
}
Method getMethod(Class klass, string signature) {
// Replace with solution from exercise 9.
any()
}
predicate callGraph(MethodAccess methodAccess, Method method) {
// Exercise 10: Associate a method call with a method by using the points-to information of the qualifier
any()
}
from MethodAccess methodAccess, Method method
where callGraph(methodAccess, method)
select methodAccess, method