1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:24:41 -07:00

big: bug fix for division

Fixes #784.

R=rsc
CC=golang-dev
https://golang.org/cl/1196043
This commit is contained in:
Robert Griesemer 2010-05-18 16:31:49 -07:00
parent 2db47c9083
commit 90d0c3316c

View File

@ -528,10 +528,15 @@ func (z nat) divLarge(u, uIn, v nat) (q, r nat) {
n := len(v)
m := len(uIn) - n
// determine if z can be reused
if alias(z, uIn) || alias(z, v) {
z = nil // z is an alias for uIn or v - cannot reuse
}
q = z.make(m + 1)
qhatv := make(nat, n+1)
if alias(u, uIn) {
u = nil // u is an alias for uIn - cannot reuse
if alias(u, uIn) || alias(u, v) {
u = nil // u is an alias for uIn or v - cannot reuse
}
u = u.make(len(uIn) + 1)
u.clear()