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
45515011
Commit
45515011
authored
Feb 02, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: final ...T bug for the day
R=ken2 CC=golang-dev
https://golang.org/cl/199046
parent
f7e2266c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
gen.c
src/cmd/gc/gen.c
+2
-0
typecheck.c
src/cmd/gc/typecheck.c
+0
-1
walk.c
src/cmd/gc/walk.c
+2
-0
ddd.go
test/ddd.go
+0
-4
No files found.
src/cmd/gc/gen.c
View file @
45515011
...
...
@@ -411,6 +411,8 @@ cgen_dcl(Node *n)
}
if
(
!
(
n
->
class
&
PHEAP
))
return
;
if
(
n
->
alloc
==
nil
)
n
->
alloc
=
callnew
(
n
->
type
);
cgen_as
(
n
->
heapaddr
,
n
->
alloc
);
}
...
...
src/cmd/gc/typecheck.c
View file @
45515011
...
...
@@ -1907,7 +1907,6 @@ addrescapes(Node *n)
n
->
class
|=
PHEAP
;
n
->
addable
=
0
;
n
->
ullman
=
2
;
n
->
alloc
=
callnew
(
n
->
type
);
n
->
xoffset
=
0
;
// create stack variable to hold pointer to heap
...
...
src/cmd/gc/walk.c
View file @
45515011
...
...
@@ -2182,6 +2182,8 @@ paramstoheap(Type **argin)
continue
;
// generate allocation & copying code
if
(
v
->
alloc
==
nil
)
v
->
alloc
=
callnew
(
v
->
type
);
nn
=
list
(
nn
,
nod
(
OAS
,
v
->
heapaddr
,
v
->
alloc
));
nn
=
list
(
nn
,
nod
(
OAS
,
v
,
v
->
stackparam
));
}
...
...
test/ddd.go
View file @
45515011
...
...
@@ -18,13 +18,11 @@ func sumC(args ...int) int {
return
func
()
int
{
return
sum
(
args
)
}
()
}
/* TODO(rsc)
var
sumD
=
func
(
args
...
int
)
int
{
return
sum
(
args
)
}
var
sumE
=
func
()
func
(
...
int
)
int
{
return
func
(
args
...
int
)
int
{
return
sum
(
args
)
}
}
()
var
sumF
=
func
(
args
...
int
)
func
()
int
{
return
func
()
int
{
return
sum
(
args
)
}
}
*/
func
sumA
(
args
[]
int
)
int
{
s
:=
0
...
...
@@ -76,7 +74,6 @@ func main() {
if
x
:=
sumC
(
4
,
5
,
6
);
x
!=
15
{
panicln
(
"sumC 15"
,
x
)
}
/* TODO(rsc)
if
x
:=
sumD
(
4
,
5
,
7
);
x
!=
16
{
panicln
(
"sumD 16"
,
x
)
}
...
...
@@ -86,7 +83,6 @@ func main() {
if
x
:=
sumF
(
4
,
5
,
9
)();
x
!=
18
{
panicln
(
"sumF 18"
,
x
)
}
*/
if
x
:=
sum2
(
1
,
2
,
3
);
x
!=
2
*
6
{
panicln
(
"sum 6"
,
x
)
}
...
...
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