I am starting to understand the pointer package. 
I already know the most definitions like inclusion-based, flow-insensitive, 
context-sensitive and so on. 

Unfortunaley I am struggeling with the context-sensitive heap. 
Does it mean that *f1 := f()* and *f2() := f()* can be distinguished 
because of the context-sensitive heap property? 
If i change f() to func* f2() *T {return &T{}}* this property does not hold 
because only the new()  creates a variable on the heap, whereas f2() 
creates a local variable [0]. 
Or in other words: Everything on the heap (new statement, ...) is context 
sensitive and local variables (on the stack) are not context sensitive. 
Is that correct?


Steps I have done to try to understand context-sensitive heap:

The paper mentioned in the docu (Hind, PASTE'01) basically asks the 
question, how a pointer analysis models the heap and describes latter 
different approaches. 

Therefore I decided to take a look at the source code. I have found the 
method [1] shouldUseContext.
It helps me to clarify what small functions are [context-insensitive except 
of smaller functions], but I does not find the context-sensitive heap.

Afterwards I tried to find the heap pattern in a different class in the 
package.
I have found a class [2] for labels which should mark also heap variables, 
but I don't figure out where it is marked.
I know that *ssa.Alloc has a field Heap which holds the information, but I 
don't find any use of the field in the pointer package.

Have I missed something to clarify my question? 
Is my current assumption about the context-sensitive heap corred? 
I hope someone can help me to clarify my question.



[0] https://www.youtube.com/watch?v=zjoieOpy5hE 10:45
[1] https://github.com/golang/tools/blob/master/go/pointer/gen.go#L550
[2] 
https://github.com/golang/tools/blob/5a2fc32f4475381b7c41823909c5ec098f07c040/go/pointer/labels.go
 


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to