Skip to content
Snippets Groups Projects
Commit 6fa29799 authored by Ian Lance Taylor's avatar Ian Lance Taylor
Browse files

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

From-SVN: r179019
parent 6675c416
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment