OSDN Git Service

Avoid crash with extra struct initializers with abstract types.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jan 2011 06:04:00 +0000 (06:04 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jan 2011 06:04:00 +0000 (06:04 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168984 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index a11e3d6..819fb61 100644 (file)
@@ -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.