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

cmd/compile: unsafe.Offsetof returns incorrect value in embedded struct with type parameters [1.18 backport] #53159

Open
gopherbot opened this issue May 31, 2022 · 3 comments
Labels
CherryPickApproved
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented May 31, 2022

@randall77 requested issue #53137 to be considered for backport to the next 1.18 minor release.

@gopherbot please open a backport issue for 1.18.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented May 31, 2022

Change https://go.dev/cl/409494 mentions this issue: [release-branch.go1.18] cmd/compile: fix wrong unsafe.Offsetof evaluation inside generic function

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented May 31, 2022

@randall77 Thanks for requesting the backport. Can you please include a brief rationale per https://go.dev/wiki/MinorReleases (third paragraph)—thanks.

@randall77
Copy link
Contributor

@randall77 randall77 commented May 31, 2022

This causes the compiler to incorrectly compile some unsafe.OffsetOf calls in generic types. It's possible to work around in some cases, but probably not all (e.g. using unsafe.OffsetOf on types in a package you don't control).

@dmitshur dmitshur removed this from the Go1.18.3 milestone Jun 1, 2022
@dmitshur dmitshur added this to the Go1.18.4 milestone Jun 1, 2022
@joedian joedian added the CherryPickApproved label Jun 22, 2022
@gopherbot gopherbot removed the CherryPickCandidate label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved
Projects
None yet
Development

No branches or pull requests

4 participants