Don't crash on if statement with erroneous conditional.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 11 Feb 2011 06:36:50 +0000 (06:36 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 11 Feb 2011 06:36:50 +0000 (06:36 +0000)
From-SVN: r170044

gcc/go/gofrontend/statements.cc

index 6b45d0111e02c438c97b48dbf2bf6e82e5154dcb..bae4be8e31be16428ed23cf1efd386a94a5c3cc4 100644 (file)
@@ -2994,7 +2994,9 @@ If_statement::do_may_fall_through() const
 tree
 If_statement::do_get_tree(Translate_context* context)
 {
-  gcc_assert(this->cond_ == NULL || this->cond_->type()->is_boolean_type());
+  gcc_assert(this->cond_ == NULL
+            || this->cond_->type()->is_boolean_type()
+            || this->cond_->type()->is_error_type());
   tree cond_tree = (this->cond_ == NULL
                    ? boolean_true_node
                    : this->cond_->get_tree(context));