math/big: incorrect handling of aliased inputs in GCD #30217
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Calculate the cofactors x, y using the input variables (a, b) to store the result
d.GCD(x, y, a, b) --> x = 1, y = -1 (correct)
d.GCD(a, b, a, b) --> a = 1, b = 1 (incorrect)
d.GCD(b, a, a, b) --> b = 1, a = -6 (incorrect)
https://play.golang.org/p/KwX7hGGIHu_k
What did you expect to see?
Correct results that match when independent x, y are used.
What did you see instead?
Incorrect results when x and y reference the input variables a, b.
The text was updated successfully, but these errors were encountered: