Example of Pointer analysis?

Hey,

im trying to understand the pointer analysis in Go. I saw there is an example but thats too complicated for now. I know orcale can do this kind of stuff but I want the same thing in code. For example this code snippet, is there a way to get the pointsTo information?
package main

// Demonstration of directionality of flow edges.

func f1() {}
func f2() {}

var somepred bool

// Tracking functions.
func flow1() {
    s := f1
    p := f2
    q := p
    r := q
    if somepred {
        r = s
    }
    print(s) // @pointsto main.f1
    print(p) // @pointsto main.f2
    print(q) // @pointsto main.f2
    print(r) // @pointsto main.f1 | main.f2
}

func main() {
    flow1()
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.