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
e2e8aa0e
Commit
e2e8aa0e
authored
Oct 14, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface equality (strings specifically)
R=r OCL=17134 CL=17134
parent
edb1412c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
walk.c
src/cmd/gc/walk.c
+0
-2
iface.c
src/runtime/iface.c
+11
-10
No files found.
src/cmd/gc/walk.c
View file @
e2e8aa0e
...
...
@@ -2572,9 +2572,7 @@ ifaceop(Type *tl, Node *n, int op)
if
(
op
==
ONE
)
r
=
nod
(
ONOT
,
r
,
N
);
dump
(
"bef"
,
r
);
walktype
(
r
,
Erv
);
dump
(
"aft"
,
r
);
return
r
;
}
...
...
src/runtime/iface.c
View file @
e2e8aa0e
...
...
@@ -13,8 +13,8 @@ typedef struct Map Map;
struct
Sigt
{
byte
*
name
;
uint32
hash
;
uint32
offset
;
// offset of substruct
uint32
hash
;
// hash of type // first is alg
uint32
offset
;
// offset of substruct
// first is width
void
(
*
fun
)(
void
);
};
...
...
@@ -265,6 +265,8 @@ sys·ifaceI2I(Sigi *si, Map *im, void *it, Map *retim, void *retit)
void
sys
·
ifaceeq
(
Map
*
im1
,
void
*
it1
,
Map
*
im2
,
void
*
it2
,
byte
ret
)
{
int32
alg
,
wid
;
if
(
debug
)
{
prints
(
"Ieq i1="
);
printiface
(
im1
,
it1
);
...
...
@@ -284,18 +286,17 @@ sys·ifaceeq(Map *im1, void *it1, Map *im2, void *it2, byte ret)
if
(
im2
==
nil
)
goto
no
;
// values
if
(
it1
!=
it2
)
// value
alg
=
im1
->
sigt
->
hash
;
if
(
alg
!=
im2
->
sigt
->
hash
)
goto
no
;
// types
if
(
im1
==
im2
)
goto
yes
;
if
(
im1
->
sigt
==
im2
->
sigt
)
goto
yes
;
if
(
im1
->
sigt
->
hash
!=
im2
->
sigt
->
hash
)
wid
=
im1
->
sigt
->
offset
;
if
(
wid
!=
im2
->
sigt
->
offset
)
goto
no
;
if
(
!
algarray
[
alg
].
equal
(
wid
,
&
it1
,
&
it2
))
goto
no
;
yes
:
ret
=
true
;
...
...
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