1
0
mirror of https://github.com/golang/go synced 2024-11-17 08:04:46 -07:00
The Go programming language
Go to file
Filippo Valsorda 89044b6d42 math/big: add comprehensive aliasing tests (and minor fixes to Exp, Rand)
TestAlias checks systematically for aliasing issues, where passing the
same value for an argument and the receiver leads to incorrect results.

We had a number of issues like that over the years:

    - #31084: Lsh on arm64
    - #30217: GCD
    - #22830: Exp due to divLarge
    - #22265: ModSqrt
    - #20490: Add and Sub
    - #11284: GCD

This CL also fixes two new minor bugs that the test found. A wrong
result would be returned by

    - Exp when the modulo and the receiver alias
    - Rand when the limit is negative and it aliases the receiver

The test runs in ~0.05s with the default -quickchecks value.

Change-Id: I8354069ec9886e40c60f2642342ee08e604befb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/168257
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
2022-04-27 17:24:48 +00:00
.github .github: remove duplicate security link 2022-01-07 17:55:09 +00:00
api net/http: add MaxBytesError 2022-04-25 23:36:50 +00:00
doc crypto/tls: remove tls10default GODEBUG flag 2022-04-27 17:20:34 +00:00
lib/time lib/time, time/tzdata: update to 2021e 2021-11-11 05:16:39 +00:00
misc Revert "cmd/compile: enable Asan check for global variables" 2022-04-22 13:59:32 +00:00
src math/big: add comprehensive aliasing tests (and minor fixes to Exp, Rand) 2022-04-27 17:24:48 +00:00
test cmd/compile/internal/syntax: parser to accept ~x as unary expression 2022-04-26 02:19:42 +00:00
.gitattributes
.gitignore internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
AUTHORS A+C: add Wen Yang (individual CLA) 2022-04-11 22:24:03 +00:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md
CONTRIBUTORS A+C: add Wen Yang (individual CLA) 2022-04-11 22:24:03 +00:00
LICENSE
PATENTS
README.md README.md: update wiki link 2022-04-26 16:21:18 +00:00
SECURITY.md SECURITY.md: replace golang.org with go.dev 2022-04-26 19:59:47 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.