projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91ab220
)
Don't crash when returning something from a function named '_'.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 21 Dec 2010 23:13:18 +0000
(23:13 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 21 Dec 2010 23:13:18 +0000
(23:13 +0000)
From-SVN: r168143
gcc/go/gofrontend/gogo.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/gogo.cc
b/gcc/go/gofrontend/gogo.cc
index 2e453844500b586aa1cb7f1204aa971174634c7b..bf197e5632e9e0592e9f480ecc1a35b3b08bab60 100644
(file)
--- 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);