From: Ian Lance Taylor Date: Tue, 21 Dec 2010 23:13:18 +0000 (+0000) Subject: Don't crash when returning something from a function named '_'. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ff48ac359242322c5dca42ea9d854422360a9ce;p=gcc.git Don't crash when returning something from a function named '_'. From-SVN: r168143 --- diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 2e453844500..bf197e5632e 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -659,7 +659,13 @@ Gogo::start_function(const std::string& name, Function_type* type, Named_object* ret; if (Gogo::is_sink_name(*pname)) - ret = Named_object::make_sink(); + { + static int sink_count; + char buf[30]; + snprintf(buf, sizeof buf, ".$sink%d", sink_count); + ++sink_count; + ret = Named_object::make_function(buf, NULL, function); + } else if (!type->is_method()) { ret = this->package_->bindings()->add_function(*pname, NULL, function);