aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-10-25 16:35:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-10-25 16:35:24 +0000
commit09367c0d60f551d7d05b6212b649a71636b623ce (patch)
treec10e4945a3688d1e9989fda3872cb8d6ba04f4e3 /libgo
parent0d53e34681bfbb0849726ee8d3b17cf330a33a76 (diff)
downloadgcc-09367c0d60f551d7d05b6212b649a71636b623ce.zip
gcc-09367c0d60f551d7d05b6212b649a71636b623ce.tar.gz
gcc-09367c0d60f551d7d05b6212b649a71636b623ce.tar.bz2
Don't permit close of receive-only channel.
Better panic on attempt to close nil channel. From-SVN: r180437
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-close.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgo/runtime/go-close.c b/libgo/runtime/go-close.c
index 44533eb..778eab3 100644
--- a/libgo/runtime/go-close.c
+++ b/libgo/runtime/go-close.c
@@ -16,6 +16,9 @@ __go_builtin_close (struct __go_channel *channel)
{
int i;
+ if (channel == NULL)
+ __go_panic_msg ("close of nil channel");
+
i = pthread_mutex_lock (&channel->lock);
__go_assert (i == 0);