From 8d620a1a26f18400eda6130f42aac8f00c8d291f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 15 Feb 2011 18:55:01 +0000 Subject: Don't crash defining function in different package. From-SVN: r170192 --- gcc/go/gofrontend/gogo-tree.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc index 73f2503..3228c42 100644 --- a/gcc/go/gofrontend/gogo-tree.cc +++ b/gcc/go/gofrontend/gogo-tree.cc @@ -1252,8 +1252,9 @@ Function::get_or_make_decl(Gogo* gogo, Named_object* no, tree id) this->fndecl_ = decl; - gcc_assert(no->package() == NULL); - if (this->enclosing_ != NULL || Gogo::is_thunk(no)) + if (no->package() != NULL) + ; + else if (this->enclosing_ != NULL || Gogo::is_thunk(no)) ; else if (Gogo::unpack_hidden_name(no->name()) == "init" && !this->type_->is_method()) -- cgit v1.1