summaryrefslogtreecommitdiff
path: root/src/runtime/sema.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-03 13:36:48 -0400
committerRuss Cox <rsc@golang.org>2014-10-03 13:36:48 -0400
commit4f87028de45e479d54ad7b18335abb4842e830ae (patch)
tree1053b53f4e6a749aafc2cc3b55ad2503cf119505 /src/runtime/sema.go
parentf35c97b05d197e8dbcebec48c052912e8e83ee2a (diff)
downloadgo-4f87028de45e479d54ad7b18335abb4842e830ae.tar.gz
runtime: clear stale values from G.param and SudoG.elem
This change was necessary on the dev.garbage branch to keep the garbage collector from seeing pointers into invalid heap areas. On this default (Go 1.4) branch, the change removes some possibility for memory leaks. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, iant, r, rlh https://codereview.appspot.com/155760043
Diffstat (limited to 'src/runtime/sema.go')
-rw-r--r--src/runtime/sema.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/sema.go b/src/runtime/sema.go
index 504462de3..a42a29988 100644
--- a/src/runtime/sema.go
+++ b/src/runtime/sema.go
@@ -173,6 +173,7 @@ func (root *semaRoot) dequeue(s *sudog) {
} else {
root.head = s.next
}
+ s.elem = nil
s.next = nil
s.prev = nil
}