From 1ed36e906f6cf62a4d4dad1c8989257eb97f5566 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 4 Jan 2011 20:18:31 +0000 Subject: Don't crash if named constant has no type when converting to GENERIC. From-SVN: r168483 --- gcc/go/gofrontend/expressions.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 013adac..840fdb3 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -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; -- cgit v1.1