runtime: clear sg.selectdone before saving in SudoG cache

Removes another dangling pointer that might
cause a memory leak in 1.4 or crash the GC in 1.5.

LGTM=rlh
R=golang-codereviews
CC=golang-codereviews, iant, khr, r, rlh
https://golang.org/cl/150520043
This commit is contained in:
Russ Cox 2014-10-03 15:33:29 -04:00
parent 0120f8378d
commit 13da360845
2 changed files with 10 additions and 1 deletions

View file

@ -174,6 +174,9 @@ func releaseSudog(s *sudog) {
if s.elem != nil {
gothrow("runtime: sudog with non-nil elem")
}
if s.selectdone != nil {
gothrow("runtime: sudog with non-nil selectdone")
}
gp := getg()
if gp.param != nil {
gothrow("runtime: releaseSudog with non-nil gp.param")