diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-04-29 18:56:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-04-29 18:56:24 +0000 |
commit | 65937ccf0ba547c4c976ece029d26c373eca62db (patch) | |
tree | fe5d7e0cacb9f8e97476efb467f4329838f27bfc | |
parent | 1978e62d47c8808f0535e7d69f3de64186e80e0e (diff) | |
download | gcc-65937ccf0ba547c4c976ece029d26c373eca62db.zip gcc-65937ccf0ba547c4c976ece029d26c373eca62db.tar.gz gcc-65937ccf0ba547c4c976ece029d26c373eca62db.tar.bz2 |
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
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 8af11d9..0b4e3f1 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 1efaadf..11bc7dd 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); } } |