This is the mail archive of the
mailing list for the GCC project.
Go patch committed: Fix composite literal with enclosing var as key
- 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, 16 Jul 2013 15:45:34 -0700
- Subject: Go patch committed: Fix composite literal with enclosing var as key
This patch to the Go frontend fixes a bug when there is a composite
literal that uses a struct field where the name of the field happens to
be the same as the name of a variable in an enclosing function. This
used to work fine, but it broke when I added a new field to function
closures as part of the change to the function representation. I've
added a test to the master Go repository to catch this in the future.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline and 4.8 branch.
diff -r a1afec89faee go/gogo.cc
--- a/go/gogo.cc Tue Jul 16 08:44:25 2013 -0700
+++ b/go/gogo.cc Tue Jul 16 15:41:23 2013 -0700
@@ -3380,7 +3380,7 @@
- unsigned int index = 0;
+ unsigned int index = 1;
for (Closure_fields::const_iterator p = this->closure_fields_.begin();
p != this->closure_fields_.end();