Fix calling make with slice whose element type is size zero.

From-SVN: r179019
This commit is contained in:
Ian Lance Taylor 2011-09-20 22:06:20 +00:00
parent 6675c41604
commit 6fa2979911
1 changed files with 2 additions and 1 deletions

View File

@ -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;