OSDN Git Service

Don't crash defining function in different package.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Feb 2011 18:55:01 +0000 (18:55 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Feb 2011 18:55:01 +0000 (18:55 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170192 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/gogo-tree.cc

index 73f2503..3228c42 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())