projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81ef977
)
Don't crash on tuple initialization from erroneous channel.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 15 Dec 2010 23:50:02 +0000
(23:50 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 15 Dec 2010 23:50:02 +0000
(23:50 +0000)
From-SVN: r167882
gcc/go/gofrontend/gogo.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/gogo.cc
b/gcc/go/gofrontend/gogo.cc
index 39072e075b1f7a0be2e15ac7e16426a51fdbae03..b27871132e33b7ac0ef7d83bf3776c3fa7659cbc 100644
(file)
--- a/
gcc/go/gofrontend/gogo.cc
+++ b/
gcc/go/gofrontend/gogo.cc
@@
-3126,7
+3126,10
@@
Variable::type_from_tuple(Expression* expr, bool report_error) const
else if (expr->receive_expression() != NULL)
{
Expression* channel = expr->receive_expression()->channel();
- return channel->type()->channel_type()->element_type();
+ Type* channel_type = channel->type();
+ if (channel_type->is_error_type())
+ return Type::make_error_type();
+ return channel_type->channel_type()->element_type();
}
else
{