Don't crash on variable initialization from erroneous receive.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 2010 16:37:58 +0000 (16:37 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 2010 16:37:58 +0000 (16:37 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168175 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index be4de9c..634eccd 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();
     }