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
2fc0b4f0
Commit
2fc0b4f0
authored
Jun 21, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: include struct field tags in type equality
R=ken2 CC=golang-dev
https://golang.org/cl/1667048
parent
96d35c69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
subr.c
src/cmd/gc/subr.c
+13
-1
No files found.
src/cmd/gc/subr.c
View file @
2fc0b4f0
...
...
@@ -1725,6 +1725,18 @@ cplxsubtype(int et)
return
0
;
}
static
int
eqnote
(
Strlit
*
a
,
Strlit
*
b
)
{
if
(
a
==
b
)
return
1
;
if
(
a
==
nil
||
b
==
nil
)
return
0
;
if
(
a
->
len
!=
b
->
len
)
return
0
;
return
memcmp
(
a
->
s
,
b
->
s
,
a
->
len
)
==
0
;
}
// Return 1 if t1 and t2 are identical, following the spec rules.
//
// Any cyclic type must go through a named type, and if one is
...
...
@@ -1745,7 +1757,7 @@ eqtype(Type *t1, Type *t2)
for
(
t1
=
t1
->
type
,
t2
=
t2
->
type
;
t1
&&
t2
;
t1
=
t1
->
down
,
t2
=
t2
->
down
)
{
if
(
t1
->
etype
!=
TFIELD
||
t2
->
etype
!=
TFIELD
)
fatal
(
"struct/interface missing field: %T %T"
,
t1
,
t2
);
if
(
t1
->
sym
!=
t2
->
sym
||
t1
->
embedded
!=
t2
->
embedded
||
!
eqtype
(
t1
->
type
,
t2
->
type
))
if
(
t1
->
sym
!=
t2
->
sym
||
t1
->
embedded
!=
t2
->
embedded
||
!
eqtype
(
t1
->
type
,
t2
->
type
)
||
!
eqnote
(
t1
->
note
,
t2
->
note
)
)
return
0
;
}
return
t1
==
T
&&
t2
==
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