Commit 8a12f5d6 authored by Cuong Manh Le's avatar Cuong Manh Le Committed by Michael Knyszek
Browse files

[release-branch.go1.16] 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 #49391

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: default avatarDavid Chase <drchase@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/361597


TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent b29e772c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment