Instead of playing whack-a-mole finding all
the non-dowidth'd expressions that can sneak
out of the frontend and then deciding on
just the right place to handle them,
use a big hammer.
Fixes #20152
Change-Id: Id452d9e8c4e9585216bd8bf0e0004c85aba4f9f7
Reviewed-on: https://go-review.googlesource.com/42021
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
return n
}
+ // Eagerly checkwidth all expressions for the back end.
+ if n.Type != nil && !n.Type.WidthCalculated() {
+ switch n.Type.Etype {
+ case TBLANK, TNIL, TIDEAL:
+ default:
+ checkwidth(n.Type)
+ }
+ }
+
if init == &n.Ninit {
// not okay to use n->ninit when walking n,
// because we might replace n with some other node