Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/pointer: extended query tuple indexing does not take flattening into account #27111

Closed
dominikh opened this issue Aug 21, 2018 · 1 comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dominikh
Copy link
Member

For

package main

type T struct {
	X *int
}

func id(x *int) (T, *int) { return T{new(int)}, x }

func main() {
	a := new(int)
	id(a)
}

with

t1 = id(t0)                                                   (T, *int)

the extended query x[1] will refer to T.X, not the second return value. The extended query parsing assumes that tuple offsets match node offsets 1 to 1, not taking into consideration that structs will be flattened, effectively yielding the tuple (T, *int, *int)

I intend on fixing this myself, eventually, unless someone beats me to it.

@dominikh dominikh added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 21, 2018
@gopherbot gopherbot added this to the Unreleased milestone Aug 21, 2018
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@adonovan
Copy link
Member

x/tools/go/pointer was deleted; see #59676.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants