diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-04 19:02:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-04 19:02:47 +0000 |
commit | f36067eb52a2475e5e628cdb65eccb65c48a3953 (patch) | |
tree | baa9af4eb5014f148ea69e06c86eec58a4ef66f7 | |
parent | 37cae45e1694c269f23e9536884f44986e46982b (diff) | |
download | gcc-f36067eb52a2475e5e628cdb65eccb65c48a3953.zip gcc-f36067eb52a2475e5e628cdb65eccb65c48a3953.tar.gz gcc-f36067eb52a2475e5e628cdb65eccb65c48a3953.tar.bz2 |
Fix handling of abstract types in temporary statements.
From-SVN: r168480
-rw-r--r-- | gcc/go/gofrontend/statements.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index ef34bba..d8ea9f0 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -340,6 +340,9 @@ Temporary_statement::do_traverse_assignments(Traverse_assignments* tassign) void Temporary_statement::do_determine_types() { + if (this->type_ != NULL && this->type_->is_abstract()) + this->type_ = this->type_->make_non_abstract_type(); + if (this->init_ != NULL) { if (this->type_ == NULL) @@ -352,10 +355,10 @@ Temporary_statement::do_determine_types() } if (this->type_ == NULL) - this->type_ = this->init_->type(); - - if (this->type_->is_abstract()) - this->type_ = this->type_->make_non_abstract_type(); + { + this->type_ = this->init_->type(); + gcc_assert(!this->type_->is_abstract()); + } } // Check types. |