]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] runtime: use correct constant when computing nsec remainder
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 4 Nov 2021 23:10:31 +0000 (00:10 +0100)
committerHeschi Kreinick <heschi@google.com>
Wed, 24 Nov 2021 19:34:05 +0000 (19:34 +0000)
commit4536558f160d147224b07c1167c1b4750b3fcca8
treeea137a25bd99ea40c13f171ebd39d2070f8fe5f2
parente347c89598d502dd82a3dbfc93c7d004e6d91f9d
[release-branch.go1.17] runtime: use correct constant when computing nsec remainder

A code comment on amd64 for windows and plan9 contained a snippet for
splitting apart the sec and nsec components of a unix timestamp, with
produced assembly below, which was then cleaned up by hand. When arm64
was ported, that code snippet in the comment went through the compiler
to produce some code that was then pasted and cleaned up. Unfortunately,
the comment had a typo in it, containing 8 zeros instead of 9.

This resulted in the constant used in the assembly being wrong, spotted
by @bufflig's eagle eyes. So, this commit fixes the comment on all three
platforms, and the assembly on windows/arm64.

Updates #48072.
Fixes #49369.

Change-Id: I786fe89147328b0d25544f52c927ddfdb9f6f1cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/361474
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Patrik Nyblom <pnyb@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/361476
src/runtime/sys_plan9_amd64.s
src/runtime/time_windows_amd64.s
src/runtime/time_windows_arm64.s