From: ian Date: Thu, 3 Mar 2011 01:48:28 +0000 (+0000) Subject: Don't crash declaring a function named "_". X-Git-Tag: upstream/4.9.2~22494 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67869e7419a1efc52146c60e73c11fd865202d6c;p=platform%2Fupstream%2Flinaro-gcc.git Don't crash declaring a function named "_". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170636 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index ab6021d..7c03870 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -2063,9 +2063,12 @@ Parse::function_decl() return; } this->advance_token(); - named_object = this->gogo_->declare_function(name, fntype, location); - if (named_object->is_function_declaration()) - named_object->func_declaration_value()->set_asm_name(asm_name); + if (!Gogo::is_sink_name(name)) + { + named_object = this->gogo_->declare_function(name, fntype, location); + if (named_object->is_function_declaration()) + named_object->func_declaration_value()->set_asm_name(asm_name); + } } // Check for the easy error of a newline before the opening brace. @@ -2082,8 +2085,8 @@ Parse::function_decl() if (!this->peek_token()->is_op(OPERATOR_LCURLY)) { - if (named_object == NULL) - named_object = this->gogo_->declare_function(name, fntype, location); + if (named_object == NULL && !Gogo::is_sink_name(name)) + this->gogo_->declare_function(name, fntype, location); } else {