OSDN Git Service

Don't crash on interface loop with forwarding types.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Feb 2011 19:53:36 +0000 (19:53 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Feb 2011 19:53:36 +0000 (19:53 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170198 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/types.cc

index 16563bb..0d17ab4 100644 (file)
@@ -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");