aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 22:45:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 22:45:24 +0000
commitd163afc5d442581b3c1e04700ec807a28c58f945 (patch)
tree97bfb976d8f61583a6091ff5ad3fb7a2b672941c /gcc
parent7a5add18a367000a3a1056b937eac29de82cd482 (diff)
downloadgcc-d163afc5d442581b3c1e04700ec807a28c58f945.zip
gcc-d163afc5d442581b3c1e04700ec807a28c58f945.tar.gz
gcc-d163afc5d442581b3c1e04700ec807a28c58f945.tar.bz2
compiler: adjust closure field indexes
This corrects the code that handles composite literals where the key is a variable in an enclosing function. See bug475.go in the testsuite. From-SVN: r200990
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/gogo.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index a21493a..6ae72b6 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -3380,7 +3380,7 @@ Function::set_closure_type()
st->push_field(Struct_field(Typed_identifier(".$f", voidptr_type,
this->location_)));
- unsigned int index = 0;
+ unsigned int index = 1;
for (Closure_fields::const_iterator p = this->closure_fields_.begin();
p != this->closure_fields_.end();
++p, ++index)