OSDN Git Service

Don't crash if named constant has no type when converting to GENERIC.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2011 20:18:31 +0000 (20:18 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2011 20:18:31 +0000 (20:18 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168483 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index 013adac..840fdb3 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;