aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-09 06:37:27 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-09 06:37:27 +0000
commit762c279900efedc1407c3c38d98601ddbff575ae (patch)
tree922a7743155df167291a1d98f94848408de944ea
parent896977b38f006cd69ace34097d1d2ee7e4cfa096 (diff)
downloadgcc-762c279900efedc1407c3c38d98601ddbff575ae.zip
gcc-762c279900efedc1407c3c38d98601ddbff575ae.tar.gz
gcc-762c279900efedc1407c3c38d98601ddbff575ae.tar.bz2
compiler: Correct handling of sink receiver.
From-SVN: r185127
-rw-r--r--gcc/go/gofrontend/gogo.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index ca57aea..5fe5aea 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -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();