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) {
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);
break;

View file

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