From: Ian Lance Taylor Date: Mon, 29 Apr 2019 18:56:24 +0000 (+0000) Subject: compiler: avoid crash on real declaration of type with existing method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65937ccf0ba547c4c976ece029d26c373eca62db;p=gcc.git compiler: avoid crash on real declaration of type with existing method This avoids a compiler crash on invalid code. Fixes https://gcc.gnu.org/PR90272 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/174377 From-SVN: r270658 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 8af11d906a4..0b4e3f186ad 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -b117b468264665cfe6ec2cf3affb48330a704fa7 +9476f6183791477dd9b883f51e2a46b224227735 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index 1efaadf8c9d..11bc7ddf616 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -7816,7 +7816,8 @@ Type_declaration::define_methods(Named_type* nt) p != this->methods_.end(); ++p) { - if (!(*p)->func_value()->is_sink()) + if ((*p)->is_function_declaration() + || !(*p)->func_value()->is_sink()) nt->add_existing_method(*p); } }