Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ae4aefdc
Commit
ae4aefdc
authored
Dec 24, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid endless loop inheriting interfaces.
From-SVN: r168216
parent
e99776d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
gcc/go/gofrontend/types.cc
+25
-2
No files found.
gcc/go/gofrontend/types.cc
View file @
ae4aefdc
...
@@ -5548,7 +5548,7 @@ Interface_type::finalize_methods()
...
@@ -5548,7 +5548,7 @@ Interface_type::finalize_methods()
const
Typed_identifier
*
p
=
&
this
->
methods_
->
at
(
from
);
const
Typed_identifier
*
p
=
&
this
->
methods_
->
at
(
from
);
if
(
!
p
->
name
().
empty
())
if
(
!
p
->
name
().
empty
())
{
{
size_t
i
=
0
;
size_t
i
;
for
(
i
=
0
;
i
<
to
;
++
i
)
for
(
i
=
0
;
i
<
to
;
++
i
)
{
{
if
(
this
->
methods_
->
at
(
i
).
name
()
==
p
->
name
())
if
(
this
->
methods_
->
at
(
i
).
name
()
==
p
->
name
())
...
@@ -5594,7 +5594,30 @@ Interface_type::finalize_methods()
...
@@ -5594,7 +5594,30 @@ Interface_type::finalize_methods()
q
!=
methods
->
end
();
q
!=
methods
->
end
();
++
q
)
++
q
)
{
{
if
(
q
->
name
().
empty
()
||
this
->
find_method
(
q
->
name
())
==
NULL
)
if
(
q
->
name
().
empty
())
{
if
(
q
->
type
()
==
p
->
type
())
error_at
(
p
->
location
(),
"interface inheritance loop"
);
else
{
size_t
i
;
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
())
{
error_at
(
p
->
location
(),
"inherited interface listed twice"
);
break
;
}
}
if
(
i
==
this
->
methods_
->
size
())
this
->
methods_
->
push_back
(
Typed_identifier
(
q
->
name
(),
q
->
type
(),
p
->
location
()));
}
}
else
if
(
this
->
find_method
(
q
->
name
())
==
NULL
)
this
->
methods_
->
push_back
(
Typed_identifier
(
q
->
name
(),
q
->
type
(),
this
->
methods_
->
push_back
(
Typed_identifier
(
q
->
name
(),
q
->
type
(),
p
->
location
()));
p
->
location
()));
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment