]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't crash on variable initialization from erroneous receive.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 22 Dec 2010 16:37:58 +0000 (16:37 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 22 Dec 2010 16:37:58 +0000 (16:37 +0000)
From-SVN: r168175

gcc/go/gofrontend/gogo.cc

index be4de9ce097d561a69e38aa5221bb7c05b81de71..634eccdcc0657cadfcd6bd15a8eafbaf3f9563b6 100644 (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();
     }