]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] cmd/compile: only update source type when processing struct...
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 5 Nov 2021 13:30:38 +0000 (20:30 +0700)
committerMichael Knyszek <mknyszek@google.com>
Thu, 2 Dec 2021 17:52:07 +0000 (17:52 +0000)
commit759a9211d4e3d3eace3125e8a55d7fca1c94dcc6
tree819018bd250f0a40d640e33e6f5b704945fdfeee
parent01779135c09ac4c2ba0d0bc7b3ae0889ad9ad989
[release-branch.go1.17] cmd/compile: only update source type when processing struct/array

This is backport of CL 3651594, with the test from CL 360057.

CL 360057 fixed missing update source type in storeArgOrLoad. However,
we should only update the type when processing struct/array. If we
update the type right before calling storeArgOrLoad, we may generate a
value with invalid type, e.g, OpStructSelect with non-struct type.

Fixes #49392

Change-Id: Ib7e10f72f818880f550aae5c9f653db463ce29b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/361594
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/361596
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/expand_calls.go
test/fixedbugs/issue49249.go [new file with mode: 0644]
test/fixedbugs/issue49378.go [new file with mode: 0644]