Commit f6cde0ad by Ian Lance Taylor

Fix channels with element type of size zero.

From-SVN: r179030
parent 6200761b
...@@ -33,7 +33,7 @@ __go_new_channel (const struct __go_type_descriptor *channel_type, ...@@ -33,7 +33,7 @@ __go_new_channel (const struct __go_type_descriptor *channel_type,
ientries = (int) entries; ientries = (int) entries;
if (ientries < 0 if (ientries < 0
|| (uintptr_t) ientries != entries || (uintptr_t) ientries != entries
|| entries > (uintptr_t) -1 / element_size) || (element_size > 0 && entries > (uintptr_t) -1 / element_size))
__go_panic_msg ("chan size out of range"); __go_panic_msg ("chan size out of range");
alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t); alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);
......
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