Don't crash on variable initialization from erroneous receive.

From-SVN: r168175
This commit is contained in:
Ian Lance Taylor 2010-12-22 16:37:58 +00:00
parent 2a4eaec2b9
commit 6430af3843
1 changed files with 1 additions and 1 deletions

View File

@ -3165,7 +3165,7 @@ Variable::type_from_tuple(Expression* expr, bool report_error) const
{
Expression* channel = expr->receive_expression()->channel();
Type* channel_type = channel->type();
if (channel_type->is_error_type())
if (channel_type->channel_type() == NULL)
return Type::make_error_type();
return channel_type->channel_type()->element_type();
}