Fix calling make with slice whose element type is size zero.
From-SVN: r179019
This commit is contained in:
parent
6675c41604
commit
6fa2979911
@ -35,7 +35,8 @@ __go_make_slice2 (const struct __go_type_descriptor *td, uintptr_t len,
|
||||
icap = (int) cap;
|
||||
if (cap < len
|
||||
|| (uintptr_t) icap != cap
|
||||
|| cap > (uintptr_t) -1U / std->__element_type->__size)
|
||||
|| (std->__element_type->__size > 0
|
||||
&& cap > (uintptr_t) -1U / std->__element_type->__size))
|
||||
__go_panic_msg ("makeslice: cap out of range");
|
||||
|
||||
ret.__count = ilen;
|
||||
|
Loading…
Reference in New Issue
Block a user