aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-09-21 00:56:28 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-09-21 00:56:28 +0000
commitf6cde0add6f1c1a27a7d9bfd962496d53e81a5e8 (patch)
tree6e307b79a425fca72af2fa968c8b6a86de61dfb6 /libgo
parent6200761b7767c35ef96e47af29a865fa77aa3a5f (diff)
downloadgcc-f6cde0add6f1c1a27a7d9bfd962496d53e81a5e8.zip
gcc-f6cde0add6f1c1a27a7d9bfd962496d53e81a5e8.tar.gz
gcc-f6cde0add6f1c1a27a7d9bfd962496d53e81a5e8.tar.bz2
Fix channels with element type of size zero.
From-SVN: r179030
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 0c6f391..2f5bf2e 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);