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
bd397d2f
Commit
bd397d2f
authored
Jul 27, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
select
R=r DELTA=29 (27 added, 1 deleted, 1 changed) OCL=13503 CL=13503
parent
eccea198
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
walk.c
src/cmd/gc/walk.c
+28
-2
No files found.
src/cmd/gc/walk.c
View file @
bd397d2f
...
...
@@ -974,13 +974,40 @@ selcase(Node *n, Node *var)
goto
out
;
recv:
walktype
(
c
->
left
,
Elv
);
// elem
if
(
c
->
right
!=
N
)
goto
recv2
;
walktype
(
c
->
left
,
Erv
);
// chan
t
=
fixchan
(
c
->
left
->
type
);
if
(
t
==
T
)
return
;
// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
on
=
syslook
(
"selectrecv"
,
1
);
argtype
(
on
,
t
->
type
);
argtype
(
on
,
t
->
type
);
a
=
c
->
left
;
// nil elem
a
=
nod
(
OLITERAL
,
N
,
N
);
a
->
val
.
ctype
=
CTNIL
;
a
->
val
.
vval
=
0
;
r
=
a
;
a
=
c
->
left
;
// chan
r
=
list
(
a
,
r
);
a
=
var
;
// sel-var
r
=
list
(
a
,
r
);
goto
out
;
recv2:
walktype
(
c
->
right
,
Erv
);
// chan
t
=
fixchan
(
c
->
right
->
type
);
if
(
t
==
T
)
return
;
walktype
(
c
->
left
,
Elv
);
// elem
convlit
(
c
->
left
,
t
->
type
);
if
(
!
ascompat
(
t
->
type
,
c
->
left
->
type
))
{
badtype
(
c
->
op
,
t
->
type
,
c
->
left
->
type
);
...
...
@@ -1958,7 +1985,6 @@ chanop(Node *n, int top)
r
=
a
;
a
=
n
->
left
;
// elem
if
(
a
==
N
)
{
a
=
nil
;
a
=
nod
(
OLITERAL
,
N
,
N
);
a
->
val
.
ctype
=
CTNIL
;
a
->
val
.
vval
=
0
;
...
...
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