OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Block forever on send/receive to/from nil channel.
[pf3gnuchains/gcc-fork.git]
/
libgo
/
runtime
/
go-rec-nb-big.c
diff --git
a/libgo/runtime/go-rec-nb-big.c
b/libgo/runtime/go-rec-nb-big.c
index
8c315b1
..
659ea1d
100644
(file)
--- a/
libgo/runtime/go-rec-nb-big.c
+++ b/
libgo/runtime/go-rec-nb-big.c
@@
-18,6
+18,13
@@
__go_receive_nonblocking_big (struct __go_channel* channel, void *val,
size_t alloc_size;
size_t offset;
+ if (channel == NULL)
+ {
+ if (closed != NULL)
+ *closed = 0;
+ return 0;
+ }
+
element_size = channel->element_type->__size;
alloc_size = (element_size + sizeof (uint64_t) - 1) / sizeof (uint64_t);