1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:34:46 -07:00

gc: issue 1231

Fixes #1231.

R=ken2
CC=golang-dev
https://golang.org/cl/3627041
This commit is contained in:
Russ Cox 2010-12-13 16:51:19 -05:00
parent dc9a3b2791
commit 1b31c37428
2 changed files with 12 additions and 1 deletions

View File

@ -433,7 +433,7 @@ cgen_discard(Node *nr)
switch(nr->op) { switch(nr->op) {
case ONAME: case ONAME:
if(!(nr->class & PHEAP) && nr->class != PEXTERN && nr->class != PFUNC) if(!(nr->class & PHEAP) && nr->class != PEXTERN && nr->class != PFUNC && nr->class != PPARAMREF)
gused(nr); gused(nr);
break; break;

View File

@ -98,4 +98,15 @@ func main() {
println("newfunc returned broken funcs") println("newfunc returned broken funcs")
panic("fail") panic("fail")
} }
ff(1)
}
func ff(x int) {
call(func() {
_ = x
})
}
func call(func()) {
} }