projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6200761
)
Fix channels with element type of size zero.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 21 Sep 2011 00:56:28 +0000
(
00:56
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 21 Sep 2011 00:56:28 +0000
(
00:56
+0000)
From-SVN: r179030
libgo/runtime/go-new-channel.c
patch
|
blob
|
history
diff --git
a/libgo/runtime/go-new-channel.c
b/libgo/runtime/go-new-channel.c
index
0c6f391
..
2f5bf2e
100644
(file)
--- 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);