]> Cypherpunks repositories - gostls13.git/commit
Fix bug when sending via select.
authorAdam Langley <agl@golang.org>
Thu, 29 Oct 2009 01:23:53 +0000 (18:23 -0700)
committerAdam Langley <agl@golang.org>
Thu, 29 Oct 2009 01:23:53 +0000 (18:23 -0700)
commitb89d6309771909674413789100c17c6d96945477
treeceb3c8cbc6cd3f492cc1802b1e53d04090582cc2
parentb691e08e2cbdbcc3963c78a60a80d0ff235600ce
Fix bug when sending via select.

selfree maintains a cache of Select structures for several sizes. In
newselect, we'll use an entry from the cache if one is found. However,
the Scase structures corresponding to a send may have been allocated
for the wrong size. In this case we'll write off the end of the Scase
into random memory and, generally, read some amount of junk in the
receive.

This patch fixes the issue by removing the cache, on the advice of
rsc.

R=rsc
CC=go-dev
http://go/go-review/1016002
src/pkg/runtime/chan.c