Don't crash defining function in different package.

From-SVN: r170192
This commit is contained in:
Ian Lance Taylor 2011-02-15 18:55:01 +00:00
parent e3a69bb44f
commit 8d620a1a26

View File

@ -1252,8 +1252,9 @@ Function::get_or_make_decl(Gogo* gogo, Named_object* no, tree id)
this->fndecl_ = decl; this->fndecl_ = decl;
gcc_assert(no->package() == NULL); if (no->package() != NULL)
if (this->enclosing_ != NULL || Gogo::is_thunk(no)) ;
else if (this->enclosing_ != NULL || Gogo::is_thunk(no))
; ;
else if (Gogo::unpack_hidden_name(no->name()) == "init" else if (Gogo::unpack_hidden_name(no->name()) == "init"
&& !this->type_->is_method()) && !this->type_->is_method())