Commit ecf7695c authored by Keith Randall's avatar Keith Randall Committed by Filippo Valsorda
Browse files

[release-branch.go1.12] cmd/compile: make sure to initialize static entries of slices

If a slice's entries are sparse, we decide to initialize it dynamically
instead of statically. That's CL 151319.

But if we do initialize it dynamically, we still need to initialize
the static entries. Typically we do that, but the bug fixed here is
that we don't if the entry's value is itself an array or struct.

To fix, use initKindLocalCode to ensure that both static and
dynamic entries are initialized via code.

Fixes #32013

Change-Id: I1192ffdbfb5cd50445c1206c4a3d8253295201dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/176904


Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
(cherry picked from commit a9e107c8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/177040


Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cdb77652
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment