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
aacdc253
Commit
aacdc253
authored
Mar 31, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
http://b/1748082
package main var f = func(a, b int) int { return a + b } R=ken OCL=26935 CL=26935
parent
441da9af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
dcl.c
src/cmd/gc/dcl.c
+6
-0
go.h
src/cmd/gc/go.h
+2
-1
No files found.
src/cmd/gc/dcl.c
View file @
aacdc253
...
...
@@ -481,8 +481,13 @@ funclit0(Type *t)
n
=
nod
(
OXXX
,
N
,
N
);
n
->
outer
=
funclit
;
n
->
dcl
=
autodcl
;
funclit
=
n
;
// new declaration context
autodcl
=
dcl
();
autodcl
->
back
=
autodcl
;
funcargs
(
t
);
}
...
...
@@ -592,6 +597,7 @@ funclit1(Type *type, Node *body)
n
->
nbody
=
body
;
compile
(
n
);
funcdepth
--
;
autodcl
=
func
->
dcl
;
// if there's no closure, we can use f directly
if
(
func
->
cvars
==
N
)
...
...
src/cmd/gc/go.h
View file @
aacdc253
...
...
@@ -131,6 +131,7 @@ struct Val
typedef
struct
Sym
Sym
;
typedef
struct
Node
Node
;
typedef
struct
Type
Type
;
typedef
struct
Dcl
Dcl
;
struct
Type
{
...
...
@@ -211,6 +212,7 @@ struct Node
Node
*
enter
;
Node
*
exit
;
Node
*
cvars
;
// closure params
Dcl
*
dcl
;
// outer autodcl
// OLITERAL/OREGISTER
Val
val
;
...
...
@@ -259,7 +261,6 @@ struct Sym
};
#define S ((Sym*)0)
typedef
struct
Dcl
Dcl
;
struct
Dcl
{
uchar
op
;
...
...
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