Thanks a lot, Steve, for your answer on how to build a context sensitive call graph.
I tried the sample code, and found it works (at least on small subjects). Just want to confirm
a few points:
(1) When I print out each CGNode, it looks like:
< Application, Ltest/sensitivecg/B, <init>()V > Context: CallStringContext: [ dispatchViaB@4 ]
If I did not interpret wrong, CallStringContext represents, for example, <int>() is called from method dispatchViaB at an invocation site: 4.So, the number 4 does not mean line number, of other program information. It merely represents a unique call site (inside dispatchViaB method) added by Wala, right? and there is no relationship between each call sites.
(2) As you mentioned before, 0-1-container CFA uses container object-sensitivity to refine call graph. In other words, the object-sensitivity is *ONLY* for any allocation sites in collection objects: the allocation site is named by a tuple of allocation sites extending to the outermost enclosing collection allocation.
In my understanding, the following (1) (2) allocation sites will be distinguished, right?
foo() {
List l1 = new LinkedList();
l1.add(new Object()); //(1)
List l2 = new LinkedList();
l2.add(new Object()); //(2)
//so that the analysis can conclude l1, and l2 are disjointed!
}
The object-sensitivity is NOT used for any other call sites un-related to collection objects,
e.g., it will not distinguish call site (3) and (4) in the following example, right? (which 1-CFA will distinguish)
foo() {
Bar bar1 = new Bar();
Bar bar2 = new Bar();
bar1.bar(); //(3)
bar2.bar(); //(4)
}
Another related question, is the object-sensitive policy adapted in the built-in pointer-to analysis in Wala?
Thanks a lot.
-Sai