diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-24 13:58:51 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-24 13:58:51 +0000 |
commit | bf6526a05328b2809a044418b14d69ffb835ef21 (patch) | |
tree | aacf525875118cd4395269b2b344238989ddadcc /gcc/go | |
parent | e15b6067f284009c690a7e84ba0cf6016a7c1c8a (diff) | |
download | gcc-bf6526a05328b2809a044418b14d69ffb835ef21.zip gcc-bf6526a05328b2809a044418b14d69ffb835ef21.tar.gz gcc-bf6526a05328b2809a044418b14d69ffb835ef21.tar.bz2 |
Don't crash when using receive on erroneous channel.
From-SVN: r170468
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 2e31e80..259faa1 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -12264,7 +12264,11 @@ tree Receive_expression::do_get_tree(Translate_context* context) { Channel_type* channel_type = this->channel_->type()->channel_type(); - gcc_assert(channel_type != NULL); + if (channel_type == NULL) + { + gcc_assert(this->channel_->type()->is_error_type()); + return error_mark_node; + } Type* element_type = channel_type->element_type(); tree element_type_tree = element_type->get_tree(context->gogo()); |