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: struct interface{} value lost passing by value [1.12 backport] #31209

Closed
gopherbot opened this issue Apr 2, 2019 · 2 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@randall77 requested issue #30956 to be considered for backport to the next 1.12 minor release.

@gopherbot, please consider this for backport to 1.12, it's a regression.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Apr 2, 2019
@gopherbot gopherbot added this to the Go1.12.2 milestone Apr 2, 2019
@gopherbot
Copy link
Author

Change https://golang.org/cl/170437 mentions this issue: [release-branch.go1.12] cmd/compile: fix literal struct interface {} lost passing by value

@randall77 randall77 self-assigned this Apr 2, 2019
@andybons andybons added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Apr 2, 2019
@gopherbot
Copy link
Author

Closed by merging 9915830 to release-branch.go1.12.

gopherbot pushed a commit that referenced this issue Apr 2, 2019
…lost passing by value

CL 135377 introduces pass strings and slices to convT2{E,I} by value.
Before that CL, all types, except interface will be allocated temporary
address. The CL changes the logic that only constant and type which
needs address (determine by convFuncName) will be allocated.

It fails to cover the case where type is static composite literal.
Adding condition to check that case fixes the issue.

Also, static composite literal node implies constant type, so consttype
checking can be removed.

Fixes #31209

Change-Id: Ifc750a029fb4889c2d06e73e44bf85e6ef4ce881
Reviewed-on: https://go-review.googlesource.com/c/go/+/168858
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit d47db6d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/170437
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
@golang golang locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants