@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "go-panic.h"
#include "channel.h"
void
@@ -14,6 +15,9 @@
size_t alloc_size;
size_t offset;
+ if (channel == NULL)
+ __go_panic_msg ("receive from nil channel");
+
alloc_size = ((channel->element_size + sizeof (uint64_t) - 1)
/ sizeof (uint64_t));
@@ -273,6 +273,9 @@
{
uint64_t ret;
+ if (channel == NULL)
+ __go_panic_msg ("receive from nil channel");
+
__go_assert (channel->element_size <= sizeof (uint64_t));
if (!__go_receive_acquire (channel, for_select))
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include "go-panic.h"
#include "channel.h"
void
@@ -14,6 +15,9 @@
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));
@@ -151,6 +151,9 @@
void
__go_send_small (struct __go_channel *channel, uint64_t val, _Bool for_select)
{
+ if (channel == NULL)
+ __go_panic_msg ("send to nil channel");
+
__go_assert (channel->element_size <= sizeof (uint64_t));
if (!__go_send_acquire (channel, for_select))