mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
reflect; SetLen() requires an addressable value
This commit is contained in:
@@ -999,7 +999,7 @@ func (v Value) SetLen(n int) {
|
||||
if v.typecode.Kind() != Slice {
|
||||
panic(&ValueError{Method: "reflect.Value.SetLen", Kind: v.Kind()})
|
||||
}
|
||||
|
||||
v.checkAddressable()
|
||||
hdr := (*sliceHeader)(v.value)
|
||||
if int(uintptr(n)) != n || uintptr(n) > hdr.cap {
|
||||
panic("reflect.Value.SetLen: slice length out of range")
|
||||
|
||||
Reference in New Issue
Block a user