]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: fix escape analysis bug
authorRuss Cox <rsc@golang.org>
Wed, 7 Nov 2012 20:15:21 +0000 (15:15 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 7 Nov 2012 20:15:21 +0000 (15:15 -0500)
commit71282131a1ab0291834f41e606ebab6c5f0ca438
treeb92db776f8fb2ae800caa2b9f1025c668739166d
parent1ebf2d85ba02ff7d3f97e52855166174d71666c2
cmd/gc: fix escape analysis bug

The code assumed that the only choices were EscNone, EscScope, and EscHeap,
so that it makes sense to set EscScope only if the current setting is EscNone.
Now that we have the many variants of EscReturn, this logic is false, and it was
causing important EscScopes to be ignored in favor of EscReturn.

Fixes #4360.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6816103
src/cmd/gc/esc.c
src/cmd/gc/subr.c
test/escape5.go