compiler, runtime: check len/cap for append(s, make(T, l)...)

The overflow checks done in growslice always reported an error for the
capacity argument, even if it was the length argument that overflowed.
This change lets the code pass the current issue4085b.go test.

Change-Id: Ib531d4675e732cdec9eac4317104d6b8ba4cfbad
Trust: Ian Lance Taylor <>
Reviewed-by: Cherry Zhang <>
3 files changed