diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-04 20:18:31 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-04 20:18:31 +0000 |
commit | 1ed36e906f6cf62a4d4dad1c8989257eb97f5566 (patch) | |
tree | 2b81f349a8401c90101625e477dfd4704762f2f5 /gcc/go | |
parent | 10d53f5d111984f56ca2420ec2485637e8da8e01 (diff) | |
download | gcc-1ed36e906f6cf62a4d4dad1c8989257eb97f5566.zip gcc-1ed36e906f6cf62a4d4dad1c8989257eb97f5566.tar.gz gcc-1ed36e906f6cf62a4d4dad1c8989257eb97f5566.tar.bz2 |
Don't crash if named constant has no type when converting to GENERIC.
From-SVN: r168483
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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; |