Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
src/cmd/gc/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)
...
@@ -974,13 +974,40 @@ selcase(Node *n, Node *var)
goto
out
;
goto
out
;
recv:
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
walktype
(
c
->
right
,
Erv
);
// chan
t
=
fixchan
(
c
->
right
->
type
);
t
=
fixchan
(
c
->
right
->
type
);
if
(
t
==
T
)
if
(
t
==
T
)
return
;
return
;
walktype
(
c
->
left
,
Elv
);
// elem
convlit
(
c
->
left
,
t
->
type
);
convlit
(
c
->
left
,
t
->
type
);
if
(
!
ascompat
(
t
->
type
,
c
->
left
->
type
))
{
if
(
!
ascompat
(
t
->
type
,
c
->
left
->
type
))
{
badtype
(
c
->
op
,
t
->
type
,
c
->
left
->
type
);
badtype
(
c
->
op
,
t
->
type
,
c
->
left
->
type
);
...
@@ -1958,7 +1985,6 @@ chanop(Node *n, int top)
...
@@ -1958,7 +1985,6 @@ chanop(Node *n, int top)
r
=
a
;
r
=
a
;
a
=
n
->
left
;
// elem
a
=
n
->
left
;
// elem
if
(
a
==
N
)
{
if
(
a
==
N
)
{
a
=
nil
;
a
=
nod
(
OLITERAL
,
N
,
N
);
a
=
nod
(
OLITERAL
,
N
,
N
);
a
->
val
.
ctype
=
CTNIL
;
a
->
val
.
ctype
=
CTNIL
;
a
->
val
.
vval
=
0
;
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