Don't crash defining function in different package.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 15 Feb 2011 18:55:01 +0000 (18:55 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 15 Feb 2011 18:55:01 +0000 (18:55 +0000)
From-SVN: r170192

gcc/go/gofrontend/gogo-tree.cc

index 73f2503f20875804f746861065eacf468fc81a83..3228c42ec3b57e1586074f7a701b89c02b9b03bf 100644 (file)
@@ -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())