If a Go program used a receiver named _ (which indicates an unnamed
variable), the gccgo frontend would crash. This patch fixes the
problem. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 576165e10507 go/gogo.cc
--- a/go/gogo.cc Fri Jan 20 15:27:09 2012 -0800
+++ b/go/gogo.cc Fri Jan 20 15:33:34 2012 -0800
@@ -637,7 +637,8 @@
++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();