mirror of
https://github.com/golang/go
synced 2024-11-18 20:44:45 -07:00
927e0f9da6
Background: some ssa.Values represent lvalues, e.g. var g = new(string) the *ssa.Global g is a **string, the address of what users think of as the global g. Querying pts(g) returns a singleton containing the object g, a *string. What users really want to see is what that in turn points to, i.e. the label for the call to new(). This change now lets users make "indirect" pointer queries, i.e. for pts(*v) where v is an ssa.Value. The oracle makes an indirect query if the type of the ssa.Value differs from the source expression type by a pointer, i.e. it's an lvalue. In other words, we're hiding the fact that compilers (e.g. ssa) internally represent globals by their address. + Tests. This serendipitously fixed an outstanding bug mentioned in the describe.go R=crawshaw CC=golang-dev https://golang.org/cl/13532043 |
||
---|---|---|
.. | ||
json | ||
testdata/src | ||
callees.go | ||
callers.go | ||
callgraph.go | ||
callstack.go | ||
describe.go | ||
freevars.go | ||
implements.go | ||
oracle_test.go | ||
oracle.go | ||
peers.go |