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
c18d1a78
Commit
c18d1a78
authored
Oct 13, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: implement new return restriction
R=ken2 CC=golang-dev
https://golang.org/cl/5245056
parent
06862617
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
go.y
src/cmd/gc/go.y
+12
-0
No files found.
src/cmd/gc/go.y
View file @
c18d1a78
...
...
@@ -1546,6 +1546,18 @@ non_dcl_stmt:
{
$$
=
nod
(
ORETURN
,
N
,
N
);
$$->
list
=
$
2
;
if
($$->
list
==
nil
)
{
NodeList
*
l
;
for
(
l
=
curfn
->
dcl
;
l
;
l
=
l
->
next
)
{
if
(
l
->
n
->
class
==
PPARAM
)
continue
;
if
(
l
->
n
->
class
!= PPARAMOUT)
break
;
if
(
l
->
n
->
sym
->
def
!= l->n)
yyerror
(
"%s is shadowed during return"
,
l
->
n
->
sym
->
name
);
}
}
}
stmt_list
:
...
...
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