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

Open
dominikh opened this issue Aug 21, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@dominikh
Copy link
Member

commented Aug 21, 2018

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 label Aug 21, 2018

@gopherbot gopherbot added this to the Unreleased milestone Aug 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.