]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: Correct handling of sink receiver.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 9 Mar 2012 06:37:27 +0000 (06:37 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 9 Mar 2012 06:37:27 +0000 (06:37 +0000)
From-SVN: r185127

gcc/go/gofrontend/gogo.cc

index ca57aea26ee20ac2bcfc74ee914e29567d82c847..5fe5aead9c0aad556894fa4c4c9e3840195891d2 100644 (file)
@@ -628,7 +628,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
       Variable* this_param = new Variable(receiver->type(), NULL, false,
                                          true, true, location);
       std::string rname = receiver->name();
-      if (rname.empty())
+      if (rname.empty() || Gogo::is_sink_name(rname))
        {
          // We need to give receivers a name since they wind up in
          // DECL_ARGUMENTS.  FIXME.
@@ -638,8 +638,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
          ++count;
          rname = buf;
        }
-      if (!Gogo::is_sink_name(rname))
-       block->bindings()->add_variable(rname, NULL, this_param);
+      block->bindings()->add_variable(rname, NULL, this_param);
     }
 
   const Typed_identifier_list* parameters = type->parameters();