This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Avoid crash with extra struct initializer
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 18 Jan 2011 22:04:06 -0800
- Subject: Go patch committed: Avoid crash with extra struct initializer
This patch to the Go frontend avoids a crash when there are extra values
for a struct initializer and the values types remain abstract.
Bootstrapped and tested on x86_64-unknown-linux-gnu. Committed to
mainline.
Ian
diff -r b701c2857f59 go/expressions.cc
--- a/go/expressions.cc Tue Jan 18 21:48:37 2011 -0800
+++ b/go/expressions.cc Tue Jan 18 22:01:01 2011 -0800
@@ -10609,6 +10609,10 @@
(*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.