compiler: adjust closure field indexes
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jul 2013 22:45:24 +0000 (22:45 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jul 2013 22:45:24 +0000 (22:45 +0000)
This corrects the code that handles composite literals where
the key is a variable in an enclosing function.  See bug475.go
in the testsuite.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200990 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index a21493a..6ae72b6 100644 (file)
@@ -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)