]> Cypherpunks repositories - gostls13.git/commit
math/big: fix destination leak into result value
authorRoger Peppe <rogpeppe@gmail.com>
Wed, 30 Nov 2011 17:29:58 +0000 (09:29 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 30 Nov 2011 17:29:58 +0000 (09:29 -0800)
commitca6de008bae698dd79adf795cd24668f36578d77
treeafad312eeede73bad6c8ab9ea5d64ec31368cdd2
parent8dce57e169255608b46bb563bb7de1581908aea6
math/big: fix destination leak into result value
This code would panic:
z := big.NewInt(1)
z.SetBit(big.NewInt(0), 2, 1)
if z.Cmp(big.NewInt(1<<2)) != 0 {
        panic("fail")
}

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5437081
src/pkg/math/big/int_test.go
src/pkg/math/big/nat.go