From f36067eb52a2475e5e628cdb65eccb65c48a3953 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 4 Jan 2011 19:02:47 +0000 Subject: [PATCH] Fix handling of abstract types in temporary statements. From-SVN: r168480 --- gcc/go/gofrontend/statements.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index ef34bba174b..d8ea9f0682a 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.