summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-21 00:56:28 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-21 00:56:28 +0000
commit79135b3081f4aa0410dd4016a17895f679710e62 (patch)
tree6e307b79a425fca72af2fa968c8b6a86de61dfb6 /libgo
parent4b7a2acdb8456340e2617171d506797787b5d5c2 (diff)
downloadgcc-79135b3081f4aa0410dd4016a17895f679710e62.tar.gz
Fix channels with element type of size zero.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179030 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-new-channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/runtime/go-new-channel.c b/libgo/runtime/go-new-channel.c
index 0c6f39185de..2f5bf2ea20a 100644
--- a/libgo/runtime/go-new-channel.c
+++ b/libgo/runtime/go-new-channel.c
@@ -33,7 +33,7 @@ __go_new_channel (const struct __go_type_descriptor *channel_type,
ientries = (int) entries;
if (ientries < 0
|| (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");
alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);