diff options
author | Russ Cox <rsc@golang.org> | 2022-04-25 14:06:10 -0400 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2022-04-26 02:28:58 +0000 |
commit | 17d7983b29ba633708a9d7b18f90ab5bc029502d (patch) | |
tree | 37a2799a2c7955a770fa5eb73435f031b6a863a3 /src/os/exec/exec_posix_test.go | |
parent | 09ada1af8f54584e46deb0d643713393a9d83b10 (diff) | |
download | go-17d7983b29ba633708a9d7b18f90ab5bc029502d.tar.gz go-17d7983b29ba633708a9d7b18f90ab5bc029502d.zip |
time: fix quickcheck test to avoid wraparounds
When we call time.Unix(s, ns), the internal representation is
s + 62135596800, where 62135596800 is the number of
seconds from Jan 1 1 to Jan 1 1970.
If quickcheck generates numbers too close to 2^63,
the addition can wraparound to make a very negative
internal 64-bit value. Wraparounds are not guarded
against, since they would not arise in any reasonable program,
so just avoid testing near them.
Fixes #52409.
Change-Id: Id466c8a34a49055ab26f2687a6b2b657cb64bed6
Reviewed-on: https://go-review.googlesource.com/c/go/+/402177
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/os/exec/exec_posix_test.go')
0 files changed, 0 insertions, 0 deletions