]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/walk: fix wrong soleComponent implementation
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 30 Mar 2022 01:55:22 +0000 (08:55 +0700)
committerMichael Pratt <mpratt@google.com>
Wed, 30 Mar 2022 15:06:59 +0000 (15:06 +0000)
commit2d34af0fd6c6cb214c3a5a8f11ef95854667dd92
treef89632717dc4554f49238801426b2abd5d121850
parentf5a42cd4b482a595a710129a25ffb5facc655569
cmd/compile/internal/walk: fix wrong soleComponent implementation

CL 367755 added soleComponent for handling 1-byte type interface conversion.
This implementation must be kept in sync with Type.SoleComponent, but it
does not. When seeing a blank field in struct, we must continue looking
at the field type to find sole component, if any. The current code just
terminate immediately, which causes wrong sole component type returned.

Fixes #52020

Change-Id: I4f506fe094fa7c5532de23467a4f9139476bb0a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/396614
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/walk/convert.go
test/fixedbugs/issue52020.go [new file with mode: 0644]