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
This commit is contained in:
Ian Lance Taylor 2013-07-16 22:45:24 +00:00
parent 7a5add18a3
commit d163afc5d4

View File

@ -3380,7 +3380,7 @@ Function::set_closure_type()
st->push_field(Struct_field(Typed_identifier(".$f", voidptr_type, st->push_field(Struct_field(Typed_identifier(".$f", voidptr_type,
this->location_))); this->location_)));
unsigned int index = 0; unsigned int index = 1;
for (Closure_fields::const_iterator p = this->closure_fields_.begin(); for (Closure_fields::const_iterator p = this->closure_fields_.begin();
p != this->closure_fields_.end(); p != this->closure_fields_.end();
++p, ++index) ++p, ++index)