Commit 762c2799 by Ian Lance Taylor

compiler: Correct handling of sink receiver.

From-SVN: r185127
parent 896977b3
...@@ -628,7 +628,7 @@ Gogo::start_function(const std::string& name, Function_type* type, ...@@ -628,7 +628,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
Variable* this_param = new Variable(receiver->type(), NULL, false, Variable* this_param = new Variable(receiver->type(), NULL, false,
true, true, location); true, true, location);
std::string rname = receiver->name(); 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 // We need to give receivers a name since they wind up in
// DECL_ARGUMENTS. FIXME. // DECL_ARGUMENTS. FIXME.
...@@ -638,8 +638,7 @@ Gogo::start_function(const std::string& name, Function_type* type, ...@@ -638,8 +638,7 @@ Gogo::start_function(const std::string& name, Function_type* type,
++count; ++count;
rname = buf; 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(); const Typed_identifier_list* parameters = type->parameters();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment