aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-02-15 19:53:36 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-02-15 19:53:36 +0000
commit158559dec972855ee988113db67e60334da2d479 (patch)
tree00cb52cdf464b0aa0ba317a596014f5fe95ba0c3
parent4e380b8e008d8e8d2e2d8033fdbea3ee88c2665d (diff)
downloadgcc-158559dec972855ee988113db67e60334da2d479.zip
gcc-158559dec972855ee988113db67e60334da2d479.tar.gz
gcc-158559dec972855ee988113db67e60334da2d479.tar.bz2
Don't crash on interface loop with forwarding types.
From-SVN: r170198
-rw-r--r--gcc/go/gofrontend/types.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 16563bb..0d17ab4 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -5659,7 +5659,7 @@ Interface_type::finalize_methods()
{
if (q->name().empty())
{
- if (q->type() == p->type())
+ if (q->type()->forwarded() == p->type()->forwarded())
error_at(p->location(), "interface inheritance loop");
else
{
@@ -5667,7 +5667,8 @@ Interface_type::finalize_methods()
for (i = from + 1; i < this->methods_->size(); ++i)
{
const Typed_identifier* r = &this->methods_->at(i);
- if (r->name().empty() && r->type() == q->type())
+ if (r->name().empty()
+ && r->type()->forwarded() == q->type()->forwarded())
{
error_at(p->location(),
"inherited interface listed twice");