compiler: Don't crash if receiver name is _.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 20 Jan 2012 23:38:33 +0000 (23:38 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 20 Jan 2012 23:38:33 +0000 (23:38 +0000)
From-SVN: r183359

gcc/go/gofrontend/gogo.cc

index 59a61bf25d816fc69c84726516001903d09d28a1..9d9bef1917da5420d2e3d6f805e2dad6d1d08fd4 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();