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
7a98315c
Commit
7a98315c
authored
Apr 29, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow "defer close(chan)"
bug found by anton R=r OCL=28001 CL=28001
parent
91ce0ef8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
go.y
src/cmd/gc/go.y
+22
-17
No files found.
src/cmd/gc/go.y
View file @
7a98315c
...
...
@@ -54,7 +54,7 @@
%
type
<
node
>
if_stmt
if_body
if_header
select_stmt
condition
%
type
<
node
>
simple_stmt
osimple_stmt
range_stmt
semi_stmt
%
type
<
node
>
expr
uexpr
pexpr
expr_list
oexpr
oexpr_list
expr_list_r
%
type
<
node
>
exprsym3_list_r
exprsym3
%
type
<
node
>
exprsym3_list_r
exprsym3
pseudocall
%
type
<
node
>
name
labelname
onew_name
new_name
new_name_list_r
new_field
%
type
<
node
>
vardcl_list_r
vardcl
Avardcl
Bvardcl
%
type
<
node
>
interfacedcl_list_r
interfacedcl
interfacedcl1
...
...
@@ -547,15 +547,13 @@ semi_stmt:
{
$$
=
nod
(
OCONTINUE
,
$
2
,
N
);
}
|
LGO
p
expr
'('
oexpr_list
')'
|
LGO
p
seudocall
{
$$
=
nod
(
OCALL
,
$
2
,
$
4
);
$$
=
nod
(
OPROC
,
$$,
N
);
$$
=
nod
(
OPROC
,
$
2
,
N
);
}
|
LDEFER
p
expr
'('
oexpr_list
')'
|
LDEFER
p
seudocall
{
$$
=
nod
(
OCALL
,
$
2
,
$
4
);
$$
=
nod
(
ODEFER
,
$$,
N
);
$$
=
nod
(
ODEFER
,
$
2
,
N
);
}
|
LGOTO
new_name
{
...
...
@@ -823,6 +821,22 @@ uexpr:
$$
=
nod
(
ORECV
,
$
2
,
N
);
}
/*
*
call
-
like
statements
that
*
can
be
preceeded
by
'defer'
and
'go'
*/
pseudocall
:
pexpr
'('
oexpr_list
')'
{
$$
=
unsafenmagic
($
1
,
$
3
);
if
($$
==
N
)
$$
=
nod
(
OCALL
,
$
1
,
$
3
);
}
|
LCLOSE
'('
expr
')'
{
$$
=
nod
(
OCLOSE
,
$
3
,
N
);
}
pexpr
:
LLITERAL
{
...
...
@@ -881,20 +895,11 @@ pexpr:
{
$$
=
nod
(
OSLICE
,
$
1
,
$
3
);
}
|
pexpr
'('
oexpr_list
')'
{
$$
=
unsafenmagic
($
1
,
$
3
);
if
($$
==
N
)
$$
=
nod
(
OCALL
,
$
1
,
$
3
);
}
|
pseudocall
|
LLEN
'('
expr
')'
{
$$
=
nod
(
OLEN
,
$
3
,
N
);
}
|
LCLOSE
'('
expr
')'
{
$$
=
nod
(
OCLOSE
,
$
3
,
N
);
}
|
LCLOSED
'('
expr
')'
{
$$
=
nod
(
OCLOSED
,
$
3
,
N
);
...
...
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