]> Cypherpunks.ru repositories - gostls13.git/commit
reflect: panic if ArrayOf is called with negative length
authorPaschalis Tsilias <paschalis.tsilias@gmail.com>
Fri, 15 Jan 2021 15:40:20 +0000 (17:40 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 15 Mar 2021 23:49:28 +0000 (23:49 +0000)
commitd7cc2f1d7c60b51c600c7d0c808610985dcd9b0c
tree4fd4a880eea80344f89c1215786977b4773dbc8a
parent661f3f15d5c96704a2fe9e91c6c40f73ff896606
reflect: panic if ArrayOf is called with negative length

Since we cannot change the signature of reflect.ArrayOf to return an
error, we panic instead of producing a wrong result.

Fixes #43603

Change-Id: I23915df8d190f35af4d00ab86768868cd621e839
Reviewed-on: https://go-review.googlesource.com/c/go/+/284136
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/reflect/all_test.go
src/reflect/type.go