Don't crash if named constant has no type when converting to GENERIC.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 4 Jan 2011 20:18:31 +0000 (20:18 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 4 Jan 2011 20:18:31 +0000 (20:18 +0000)
From-SVN: r168483

gcc/go/gofrontend/expressions.cc

index 013adacebcf20ec81e9a716d8084a3089566c21d..840fdb37d10604b1683956da54a0c23e3ac29f5f 100644 (file)
@@ -2680,7 +2680,8 @@ Const_expression::do_get_tree(Translate_context* context)
   // object is an abstract int or float, we try to get the abstract
   // value.  Otherwise we may lose something in the conversion.
   if (this->type_ != NULL
-      && this->constant_->const_value()->type()->is_abstract())
+      && (this->constant_->const_value()->type() == NULL
+         || this->constant_->const_value()->type()->is_abstract()))
     {
       Expression* expr = this->constant_->const_value()->expr();
       mpz_t ival;