aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-send-big.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-05-20 00:18:15 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-05-20 00:18:15 +0000
commit9ff56c9570642711d5b7ab29920ecf5dbff14a27 (patch)
treec891bdec1e6f073f73fedeef23718bc3ac30d499 /libgo/runtime/go-send-big.c
parent37cb25ed7acdb844b218231130e54b8b7a0ff6e6 (diff)
downloadgcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.zip
gcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.tar.gz
gcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.tar.bz2
Update to current version of Go library.
From-SVN: r173931
Diffstat (limited to 'libgo/runtime/go-send-big.c')
-rw-r--r--libgo/runtime/go-send-big.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libgo/runtime/go-send-big.c b/libgo/runtime/go-send-big.c
index c273263..0b4aa04 100644
--- a/libgo/runtime/go-send-big.c
+++ b/libgo/runtime/go-send-big.c
@@ -12,19 +12,20 @@
void
__go_send_big (struct __go_channel* channel, const void *val, _Bool for_select)
{
+ uintptr_t element_size;
size_t alloc_size;
size_t offset;
if (channel == NULL)
__go_panic_msg ("send to nil channel");
- alloc_size = ((channel->element_size + sizeof (uint64_t) - 1)
- / sizeof (uint64_t));
+ element_size = channel->element_type->__size;
+ alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);
__go_send_acquire (channel, for_select);
offset = channel->next_store * alloc_size;
- __builtin_memcpy (&channel->data[offset], val, channel->element_size);
+ __builtin_memcpy (&channel->data[offset], val, element_size);
__go_send_release (channel);
}