]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: only update source type when processing struct/array
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 5 Nov 2021 13:30:38 +0000 (20:30 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 5 Nov 2021 16:35:00 +0000 (16:35 +0000)
commitf249fa27a9117dd5986f35463fc6a1467ecc72bb
treeb472ac380ef67c3d9b14ba44c2f4d1e27d24aa9f
parenta0d661ab0ff896abe45d6d4e79cb71df233c5319
cmd/compile: only update source type when processing struct/array

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 #49378

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>
src/cmd/compile/internal/ssa/expand_calls.go
test/fixedbugs/issue49378.go [new file with mode: 0644]