From 9081b67b9c1d4ed828b03fa2b63861287108ff33 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Jan 2011 06:04:00 +0000 Subject: [PATCH] Avoid crash with extra struct initializers with abstract types. From-SVN: r168984 --- gcc/go/gofrontend/expressions.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index a11e3d6fa17..819fb616452 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -10609,6 +10609,10 @@ Struct_construction_expression::do_determine_type(const Type_context*) (*pv)->determine_type(&subcontext); } } + // Extra values are an error we will report elsewhere; we still want + // to determine the type to avoid knockon errors. + for (; pv != this->vals_->end(); ++pv) + (*pv)->determine_type_no_context(); } // Check types. -- 2.30.2