OSDN Git Service

compiler: Don't crash if receiver name is _.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jan 2012 23:38:33 +0000 (23:38 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jan 2012 23:38:33 +0000 (23:38 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183359 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo.cc

index 59a61bf..9d9bef1 100644 (file)
@@ -637,7 +637,8 @@ Gogo::start_function(const std::string& name, Function_type* type,
          ++count;
          name = buf;
        }
-      block->bindings()->add_variable(name, NULL, this_param);
+      if (!Gogo::is_sink_name(name))
+       block->bindings()->add_variable(name, NULL, this_param);
     }
 
   const Typed_identifier_list* parameters = type->parameters();