aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-rec-nb-small.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-rec-nb-small.c')
-rw-r--r--libgo/runtime/go-rec-nb-small.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/runtime/go-rec-nb-small.c b/libgo/runtime/go-rec-nb-small.c
index eb0a25e..0543920 100644
--- a/libgo/runtime/go-rec-nb-small.c
+++ b/libgo/runtime/go-rec-nb-small.c
@@ -97,6 +97,14 @@ __go_receive_nonblocking_small (struct __go_channel *channel)
uintptr_t element_size;
struct __go_receive_nonblocking_small ret;
+ if (channel == NULL)
+ {
+ ret.__val = 0;
+ ret.__success = 0;
+ ret.__closed = 0;
+ return ret;
+ }
+
element_size = channel->element_type->__size;
__go_assert (element_size <= sizeof (uint64_t));