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
Assignees
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 2, 2019

@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

This comment has been minimized.

Copy link
Author

@gopherbot gopherbot commented Apr 2, 2019

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
@gopherbot

This comment has been minimized.

Copy link
Author

@gopherbot gopherbot commented Apr 2, 2019

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

@gopherbot gopherbot closed this Apr 2, 2019
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.