compiler: avoid crashing on invalid non-integer array length

Tweak the array type checking code to avoid crashing on array types
whose length expressions are explicit non-integer types (for example,
"float64(10)"). If such constructs are seen, issue an "invalid array
bound" error.

Fixes golang/go#13486.

Change-Id: Iaf8ed8fda23d8624fa4f15e1a6c4f5b53225d190
Reviewed-on: https://go-review.googlesource.com/91975
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed