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

gopherbot opened this issue Apr 2, 2019 · 2 comments


None yet
3 participants
Copy link

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.


This comment has been minimized.

Copy link

commented Apr 2, 2019

Change 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


This comment has been minimized.

Copy link

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

[release-branch.go1.12] cmd/compile: fix literal struct interface {} …
…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
Run-TryBot: Ian Lance Taylor <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Keith Randall <>
(cherry picked from commit d47db6d)
Run-TryBot: Andrew Bonventre <>
Reviewed-by: Cherry Zhang <>
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.