projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e15b606
)
Don't crash when using receive on erroneous channel.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 24 Feb 2011 13:58:51 +0000
(13:58 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 24 Feb 2011 13:58:51 +0000
(13:58 +0000)
From-SVN: r170468
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index 2e31e8064785f30fd1e7605bf46a6c95ff55af78..259faa128ecae70fb9b75123b540de1fd4076c3e 100644
(file)
--- 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());