aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-04 20:18:31 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-04 20:18:31 +0000
commit1ed36e906f6cf62a4d4dad1c8989257eb97f5566 (patch)
tree2b81f349a8401c90101625e477dfd4704762f2f5 /gcc/go
parent10d53f5d111984f56ca2420ec2485637e8da8e01 (diff)
downloadgcc-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.cc3
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;