Avoid crash with extra struct initializers with abstract types.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 19 Jan 2011 06:04:00 +0000 (06:04 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 19 Jan 2011 06:04:00 +0000 (06:04 +0000)
From-SVN: r168984

gcc/go/gofrontend/expressions.cc

index a11e3d6fa176ffd3ed31398f4eab155ad6a66c2c..819fb616452b786f59a3658526e2011b22cace03 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.