Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
0ca551fc
Commit
0ca551fc
authored
Jul 18, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loop in subtype
SVN=127933
parent
c3e9c7d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
subr.c
src/cmd/gc/subr.c
+12
-7
No files found.
src/cmd/gc/subr.c
View file @
0ca551fc
...
...
@@ -1281,7 +1281,7 @@ eqtype(Type *t1, Type *t2, int d)
}
static
int
subtype
(
Type
**
stp
,
Type
*
t
)
subtype
(
Type
**
stp
,
Type
*
t
,
int
d
)
{
Type
*
st
;
...
...
@@ -1289,6 +1289,11 @@ loop:
st
=
*
stp
;
if
(
st
==
T
)
return
0
;
d
++
;
if
(
d
>=
10
)
return
0
;
switch
(
st
->
etype
)
{
default:
return
0
;
...
...
@@ -1304,18 +1309,18 @@ loop:
break
;
case
TMAP
:
if
(
subtype
(
&
st
->
down
,
t
))
if
(
subtype
(
&
st
->
down
,
t
,
d
))
break
;
stp
=
&
st
->
type
;
goto
loop
;
case
TFUNC
:
for
(;;)
{
if
(
subtype
(
&
st
->
type
,
t
))
if
(
subtype
(
&
st
->
type
,
t
,
d
))
break
;
if
(
subtype
(
&
st
->
type
->
down
->
down
,
t
))
if
(
subtype
(
&
st
->
type
->
down
->
down
,
t
,
d
))
break
;
if
(
subtype
(
&
st
->
type
->
down
,
t
))
if
(
subtype
(
&
st
->
type
->
down
,
t
,
d
))
break
;
return
0
;
}
...
...
@@ -1323,7 +1328,7 @@ loop:
case
TSTRUCT
:
for
(
st
=
st
->
type
;
st
!=
T
;
st
=
st
->
down
)
if
(
subtype
(
&
st
->
type
,
t
))
if
(
subtype
(
&
st
->
type
,
t
,
d
))
return
1
;
return
0
;
}
...
...
@@ -1333,7 +1338,7 @@ loop:
void
argtype
(
Node
*
on
,
Type
*
t
)
{
if
(
!
subtype
(
&
on
->
type
,
t
))
if
(
!
subtype
(
&
on
->
type
,
t
,
0
))
fatal
(
"argtype: failed %N %T
\n
"
,
on
,
t
);
}
...
...
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