mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
0120f8378d
commit
13da360845
2 changed files with 10 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue