Commit 6fa29799 by Ian Lance Taylor

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

From-SVN: r179019
parent 6675c416
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment