Pointer Flow Graph with C.S.
Pointer flow graph of a program is a directed graph that expresses how objects flow among the pointers in the program.
Nodes: CSPointer = (C × V) ∪ (C × O × F)
A node n represents a context-sensitive variable or a field of a context-sensitive abstract object. With C.S., the nodes (pointers) are qualified by contexts.
Edges: CSPointer × CSPointer
An edge x→y means that the objects pointed by pointer x may flow to (and also be pointed to by) pointer y. e.g., edge c: a → c’: b means that objects in pt(c: a) may flow to pt(c’: b).
The PFG contains two nodes for variable n in method id(), one node per context.
callsite 拥有上下文的原因是,同一个 callsite 其在不同的上下文中,调用的方法可能是不同的。以此例来看,如果 x.foo(a1,a2)
中的 x 是由参数传入,那么在不同的上下文之下,x 可能指向不同的对象。
注:AddEdge(s, t)
中的 s
指 source,t
指 target。
Select in Processcall