This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Don't permit abstract type in string index
- 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: Mon, 21 Feb 2011 19:56:47 -0800
- Subject: Go patch committed: Don't permit abstract type in string index
This patch to the Go frontend avoids having abstract types in a string
index expression. They should never have been permitted, and permitting
them can lead to some odd compiler crashes. Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r ec523f2fe807 go/expressions.cc
--- a/go/expressions.cc Mon Feb 21 19:23:12 2011 -0800
+++ b/go/expressions.cc Mon Feb 21 19:40:23 2011 -0800
@@ -9567,10 +9567,9 @@
String_index_expression::do_determine_type(const Type_context*)
{
this->string_->determine_type_no_context();
- Type_context subcontext(NULL, true);
- this->start_->determine_type(&subcontext);
+ this->start_->determine_type_no_context();
if (this->end_ != NULL)
- this->end_->determine_type(&subcontext);
+ this->end_->determine_type_no_context();
}
// Check types of a string index.