mirror of
https://github.com/golang/go
synced 2024-11-02 09:28:34 +00:00
gc: issue 1231
Fixes #1231. R=ken2 CC=golang-dev https://golang.org/cl/3627041
This commit is contained in:
parent
dc9a3b2791
commit
1b31c37428
2 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue