OSDN Git Service

Don't crash on if statement with erroneous conditional.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2011 06:36:50 +0000 (06:36 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2011 06:36:50 +0000 (06:36 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170044 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/statements.cc

index 6b45d01..bae4be8 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));