all: REVERSE MERGE dev.boringcrypto (cdcb4b6) into master
This commit is a REVERSE MERGE.
It merges dev.boringcrypto back into its parent branch, master.
This marks the end of development on dev.boringcrypto.
Manual Changes:
- git rm README.boringcrypto.md
- git rm -r misc/boring
- git rm src/cmd/internal/notsha256/sha256block_arm64.s
- git cherry-pick -n 5856aa74 # remove GOEXPERIMENT=boringcrypto forcing in cmd/dist
There are some minor cleanups like merging import statements
that I will apply in a follow-up CL.
Merge List:
+ 2022-04-29 cdcb4b6ef3 [dev.boringcrypto] cmd/compile: remove the awful boringcrypto kludge
+ 2022-04-29 e845f572ec [dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache
+ 2022-04-29 a840bf871e [dev.boringcrypto] crypto/internal/boring: add GC-aware cache
+ 2022-04-29 0184fe5ece [dev.boringcrypto] crypto/x509: remove VerifyOptions.IsBoring
+ 2022-04-29 9e9c7a0aec [dev.boringcrypto] crypto/..., go/build: align deps test with standard rules
+ 2022-04-29 0ec08283c8 [dev.boringcrypto] crypto/internal/boring: make SHA calls allocation-free
+ 2022-04-29 3cb10d14b7 [dev.boringcrypto] crypto/internal/boring: avoid allocation in big.Int conversion
+ 2022-04-29 509776be5d [dev.boringcrypto] cmd/dist: default to use of boringcrypto
+ 2022-04-29 f4c0f42f99 [dev.boringcrypto] all: add boringcrypto build tags
+ 2022-04-29 1f0547c4ec [dev.boringcrypto] cmd/go: pass dependency syso to cgo too
+ 2022-04-29 e5407501cb [dev.boringcrypto] cmd: use notsha256 instead of md5, sha1, sha256
+ 2022-04-29 fe006d6410 [dev.boringcrypto] cmd/internal/notsha256: add new package
+ 2022-04-27 ec7f5165dd [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-04-22 ca6fd39cf6 [dev.boringcrypto] misc/boring: skip long tests during build.release
+ 2022-04-21 19e4b10f2f [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-04-20 e07d63964b [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-04-13 1f11660f54 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2022-04-13 bc3e5d0ab7 [dev.boringcrypto] misc/boring: remove -trust and individual reviewers
+ 2022-04-05 4739b353bb [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-03-30 9d6ab825f6 [dev.boringcrypto] make.bash: disable GOEXPERIMENT when using bootstrap toolchain
+ 2022-03-30 d1405d7410 [dev.boringcrypto] crypto/internal/boring: update build instructions to use podman
+ 2022-03-29 50b8f490e1 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-03-15 0af0e19368 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2022-03-07 f492793839 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-03-07 768804dfdd [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2022-02-11 8521d1ea34 [dev.boringcrypto] misc/boring: use go install cmd@latest for installing command
+ 2022-02-11 b75258fdd8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2022-02-08 74d25c624c [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-02-03 e14fee553a [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2022-01-14 d382493a20 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-12-09 069bbf5434 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-12-06 21fa0b2199 [dev.boringcrypto] crypto/internal/boring: add -pthread linker flag
+ 2021-12-03 a38b43e4ab [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-11-09 16215e5340 [dev.boringcrypto] cmd/compile: disable version test on boringcrypto
+ 2021-11-08 c9858c7bdc [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2021-11-05 ed07c49cb6 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2021-11-05 dc2658558d [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-10-28 69d5e469a4 [dev.boringcrypto] all: convert +build to //go:build lines in boring-specific files
+ 2021-10-08 2840ccbc05 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-10-08 114aa69932 [dev.boringcrypto] misc/boring: fix Docker Hub references
+ 2021-10-08 7d26add6d5 [dev.boringcrypto] misc/boring: publish to Artifact Registry
+ 2021-08-27 5ae200d526 [dev.boringcrypto] crypto/tls: permit P-521 in FIPS mode
+ 2021-08-26 083811d079 [dev.boringcrypto] crypto/tls: use correct config in TestBoringClientHello
+ 2021-08-16 c7e7ce5ec1 [dev.boringcrypto] all: merge commit 57c115e1 into dev.boringcrypto
+ 2021-08-10 1fb58d6cad [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-07-14 934db9f0d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-06-08 a890a4de30 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-05-13 ed1f812cef [dev.boringcrypto] all: merge commit 9d0819b27c (CL 314609) into dev.boringcrypto
+ 2021-05-10 ad1b6f3ee0 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-04-21 11061407d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-03-23 b397e0c028 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-03-15 128cecc70b [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-03-10 5e2f5a38c4 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-02-26 42089e72fd [dev.boringcrypto] api: add crypto/boring.Enabled
+ 2021-02-24 03cd666173 [dev.boringcrypto] all: merge master (5b76343) into dev.boringcrypto
+ 2021-02-17 0f210b75f9 [dev.boringcrypto] all: merge master (2f0da6d) into dev.boringcrypto
+ 2021-02-12 1aea1b199f [dev.boringcrypto] misc/boring: support codereview.cfg in merge.sh
+ 2021-02-07 0d34d85dee [dev.boringcrypto] crypto/internal/boring: remove .llvm_addrsig section
+ 2021-02-07 325e03a64f [dev.boringcrypto] all: add codereview.cfg
+ 2021-02-05 d4f73546c8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-01-20 cf8ed7cca4 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2021-01-20 f22137d785 [dev.boringcrypto] misc/boring: add -trust and roland@ to merge.sh and release.sh
+ 2020-12-12 e5c7bd0efa [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-12-02 5934c434c1 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-12-01 dea96ada17 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-11-18 906d6e362b [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-11-18 95ceba18d3 [dev.boringcrypto] crypto/hmac: merge up to 2a206c7 and skip test
+ 2020-11-17 0985c1bd2d [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-11-16 af814af6e7 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-11-05 f42bd50779 [dev.boringcrypto] crypto/internal/boring: update BoringCrypto module to certificate 3678
+ 2020-10-19 ceda58bfd0 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-09-29 af85c47233 [dev.boringcrypto] misc/boring: bump version to b6
+ 2020-09-29 f9b86a6562 [dev.boringcrypto] go/build: satisfy the boringcrypto build tag
+ 2020-09-29 ef2b318974 [dev.boringcrypto] crypto/boring: expose boring.Enabled()
+ 2020-09-14 3782421230 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-08-18 6bbe47ccb6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-07-21 6e6e0b73d6 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-07-09 d85ef2b979 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-07-09 a91ad4250c [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-06-10 5beb39baf8 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-05-07 dd98c0ca3f [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-05-07 a9d2e3abf7 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-05-07 c19c0a047b [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-05-07 36c94f8421 [dev.boringcrypto] crypto/internal/boring: reject short signatures in VerifyRSAPKCS1v15
+ 2020-05-07 ee159d2f35 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-04-08 e067ce5225 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2020-03-03 79284c2873 [dev.boringcrypto] crypto/internal/boring: make accesses to RSA types with finalizers safer
+ 2020-03-02 6c64b188a5 [dev.boringcrypto] crypto/internal/boring: update BoringCrypto module to certificate 3318
+ 2020-02-28 13355c78ff [dev.boringcrypto] misc/boring: add go1.14b4 to RELEASES file
+ 2020-02-28 4980c6b317 [dev.boringcrypto] misc/boring: x/build/cmd/release doesn't take subrepo flags anymore
+ 2020-02-28 601da81916 [dev.boringcrypto] misc/boring: make merge.sh and release.sh a little more robust
+ 2020-02-14 09bc5e8723 [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2020-02-06 f96dfe6b73 [dev.boringcrypto] misc/boring: add go1.13.7b4 and go1.12.16b4 releases to RELEASES file
+ 2020-02-05 2f9b2e75c4 [dev.boringcrypto] misc/docker: update Dockerfile to match recent Buster based golang images
+ 2020-02-05 527880d05c [dev.boringcrypto] misc/boring: update default CL reviewer to katie@golang.org
+ 2019-11-25 50ada481fb [dev.boringcrypto] misc/boring: add new releases to RELEASES file
+ 2019-11-20 6657395adf [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-11-20 ab0a649d44 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-11-19 62ce702c77 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-10-25 e8f14494a0 [dev.boringcrypto] misc/boring: add go1.13.3b4 and go1.12.12b4 to RELEASES file
+ 2019-10-17 988e4d832e [dev.boringcrypto] misc/boring: add go1.13.2b4 and go1.12.11b4 to RELEASES file
+ 2019-10-11 974fd1301a [dev.boringcrypto] misc/boring: publish to Docker Hub all releases, not only the latest
+ 2019-09-27 62ce8cd3ad [dev.boringcrypto] misc/boring: add go1.13.1b4 and go1.12.10b4 to RELEASES file
+ 2019-09-10 489d268683 [dev.boringcrypto] misc/boring: add Go+BoringCrypto 1.13b4 to RELEASES file
+ 2019-09-04 e0ee09095c [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-09-03 ff197f326f [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-08-21 5a1705286e [dev.boringcrypto] misc/boring: add go1.12.9b4 to RELEASES
+ 2019-08-15 1ebc594b3c [dev.boringcrypto] misc/boring: add go1.12.8b4 and go1.11.13b4 to RELEASES
+ 2019-08-13 9417029290 [dev.boringcrypto] misc/boring: remove download of releaselet.go in build.release
+ 2019-08-05 2691091a4a misc/boring: add Go 1.11.12b4 and 1.12.7b4 to RELEASES
+ 2019-07-19 6eccf6a6cd [dev.boringcrypto] misc/boring: add scripts to automate merges and releases
+ 2019-06-27 98188f3001 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-06-13 5c354e66d1 [dev.boringcrypto] misc/boring: add go1.12.6b4 and go1.11.11b4 releases
+ 2019-06-09 9bf9e7d4b2 [dev.boringcrypto] crypto: move crypto/internal/boring imports to reduce merge conflicts
+ 2019-06-05 324f8365be [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-05-28 e48f228c9b [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-05-14 42e353245c [dev.boringcrypto] misc/boring: add go1.12.5b4 release
+ 2019-03-29 211a13fd44 [dev.boringcrypto] misc/boring: add go1.11.6b4 to RELEASES
+ 2019-03-28 347af7f060 [dev.boringcrypto] misc/boring: add go1.12.1b4 and update build scripts
+ 2019-02-27 a10558f870 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-02-08 4ed8ad4d69 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2019-01-24 14c64dbc4a [dev.boringcrypto] misc/boring: add go1.10.8b4 and go1.11.5b4
+ 2018-12-15 3f9e53f346 [dev.boringcrypto] misc/boring: add go1.10.7b4 and go1.11.4b4 releases
+ 2018-12-14 92d975e906 [dev.boringcrypto] misc/boring: add go1.11.2b4 release
+ 2018-11-14 c524da4917 [dev.boringcrypto] crypto/tls: test for TLS 1.3 to be disabled in FIPS mode
+ 2018-11-14 bfd6d30118 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 0007017f96 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 3169778c15 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 ab37582eb0 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 e8b3500d5c [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 de153ac2a1 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-14 0cbb11c720 [dev.boringcrypto] cmd/compile: by default accept any language
+ 2018-11-13 11e916773e [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-11-13 af07f7734b [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-10-25 13bf5b80e8 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-10-15 623650b27a [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-10-01 36c789b1fd [dev.boringcrypto] misc/boring: add go1.10.4b4 and go1.11b4 releases
+ 2018-09-07 693875e3f2 [dev.boringcrypto] crypto/internal/boring: avoid an allocation in AES-GCM Seal and Open
+ 2018-09-06 4d1aa482b8 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-08-04 7eb1677c01 [dev.boringcrypto] crypto/internal/boring: fix aesCipher implementation of gcmAble
+ 2018-07-11 eaa3e94eb8 [dev.boringcrypto] misc/boring: add go1.9.7b4 and go1.10.3b4 releases
+ 2018-07-11 5f0402a26b [dev.boringcrypto] misc/boring: support build.release on macOS
+ 2018-07-03 77db076129 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-06-13 b77f5e4c85 [dev.boringcrypto] crypto/rsa: drop random source reading emulation
+ 2018-06-08 a4b7722ffa [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-05-29 18db93d7e6 [dev.boringcrypto] crypto/tls: restore AES-GCM priority when BoringCrypto is enabled
+ 2018-05-25 3d9a6ac709 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-05-18 019a994e32 [dev.boringcrypto] crypto/rsa: fix boringFakeRandomBlind to work with (*big.Int).ModInverse
+ 2018-05-17 a3f9ce3313 [dev.boringcrypto] all: merge master into dev.boringcrypto
+ 2018-02-09 528dad8c72 [dev.cryptoboring] misc/boring: update README for Bazel
+ 2018-02-06 c3d83ee31c [dev.boringcrypto] misc/boring: add go1.9.3b4 to RELEASES
+ 2017-12-13 f62a24349d [dev.boringcrypto] all: merge go1.10beta1 into dev.boringcrypto
+ 2017-12-06 3e52f22ece [dev.boringcrypto] crypto/internal/boring: add MarshalBinary/UnmarshalBinary to hashes
+ 2017-12-06 5379f7847f [dev.boringcrypto] all: merge master (more nearly Go 1.10 beta 1) into dev.boringcrypto
+ 2017-12-06 185e6094fd [dev.boringcrypto] all: merge master (nearly Go 1.10 beta 1) into dev.boringcrypto
+ 2017-11-20 c36033a379 [dev.boringcrypto] misc/boring: add go1.9.2b4 release
+ 2017-11-20 cda3c6f91d [dev.boringcrypto] all: merge go1.9.2 into dev.boringcrypto
+ 2017-10-25 2ea7d3461b [release-branch.go1.9] go1.9.2
+ 2017-10-25 d93cb46280 [release-branch.go1.9] runtime: use simple, more robust fastrandn
+ 2017-10-25 78952c06c5 [release-branch.go1.9] cmd/compile: fix sign-extension merging rules
+ 2017-10-25 79996e4a1d [release-branch.go1.9] cmd/compile: avoid generating large offsets
+ 2017-10-25 f36b12657c [release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 after flush
+ 2017-10-25 dffc9319f1 [release-branch.go1.9] cmd/cgo: support large unsigned macro again
+ 2017-10-25 33ce1682c7 [release-branch.go1.9] cmd/cgo: avoid using common names for sniffing
+ 2017-10-25 f69668e1d0 [release-branch.go1.9] os: skip TestPipeThreads as flaky for 1.9
+ 2017-10-25 9be38a15e4 [release-branch.go1.9] runtime: avoid monotonic time zero on systems with low-res timers
+ 2017-10-25 8bb333a9c0 [release-branch.go1.9] doc: document Go 1.9.2
+ 2017-10-25 0758d2b9da [release-branch.go1.9] cmd/go: clean up x.exe properly in TestImportMain
+ 2017-10-25 d487b15a61 [release-branch.go1.9] cmd/compile: omit ICE diagnostics after normal error messages
+ 2017-10-25 fd17253587 [release-branch.go1.9] database/sql: prevent race in driver by locking dc in Next
+ 2017-10-25 7e7cb30475 [release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes for sockets
+ 2017-10-25 f259aed082 [release-branch.go1.9] internal/poll: do not call SetFileCompletionNotificationModes if it is broken
+ 2017-10-25 39d4bb9c0f [release-branch.go1.9] cmd/go: correct directory used in checkNestedVCS test
+ 2017-10-25 bfc22319aa [release-branch.go1.9] crypto/x509: reject intermediates with unknown critical extensions.
+ 2017-10-25 a1e34abfb3 [release-branch.go1.9] net/smtp: NewClient: set tls field to true when already using a TLS connection
+ 2017-10-25 7dadd8d517 [release-branch.go1.9] net: increase expected time to dial a closed port on all Darwin ports
+ 2017-10-25 d80889341c [release-branch.go1.9] cmd/compile: fix merge rules for panic calls
+ 2017-10-25 87b3a27839 [release-branch.go1.9] net: bump TestDialerDualStackFDLeak timeout on iOS
+ 2017-10-25 ebfcdef901 [release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off
+ 2017-10-25 0ab99b396d [release-branch.go1.9] cmd/compile: fix regression in PPC64.rules move zero
+ 2017-10-25 8d4279c111 [release-branch.go1.9] internal/poll: be explicit when using runtime netpoller
+ 2017-10-25 1ded8334f7 [release-branch.go1.9] cmd/compile/internal/syntax: fix source buffer refilling
+ 2017-10-25 ff8289f879 [release-branch.go1.9] reflect: fix pointer past-the-end in Call with zero-sized return value
+ 2017-10-25 bd34e74134 [release-branch.go1.9] log: fix data race on log.Output
+ 2017-10-25 0b55d8dbfc [release-branch.go1.9] cmd/compile: replace GOROOT in //line directives
+ 2017-10-25 5c48811aec [release-branch.go1.9] cmd/compile: limit the number of simultaneously opened files to avoid EMFILE/ENFILE errors
+ 2017-10-25 8c7fa95ad3 [release-branch.go1.9] expvar: make (*Map).Init clear existing keys
+ 2017-10-25 ccd5abc105 [release-branch.go1.9] cmd/compile: simplify "missing function body" error message
+ 2017-10-25 2e4358c960 [release-branch.go1.9] time: fix documentation of Round, Truncate behavior for d <= 0
+ 2017-10-25 c6388d381e [release-branch.go1.9] runtime: capture runtimeInitTime after nanotime is initialized
+ 2017-10-25 724638c9d8 [release-branch.go1.9] crypto/x509: skip TestSystemRoots
+ 2017-10-25 ed3b0d63b7 [release-branch.go1.9] internal/poll: add tests for Windows file and serial ports
+ 2017-10-04 93322a5b3d [release-branch.go1.9] doc: add missing "Minor revisions" header for 1.9
+ 2017-10-04 7f40c1214d [release-branch.go1.9] go1.9.1
+ 2017-10-04 598433b17a [release-branch.go1.9] doc: document go1.9.1 and go1.8.4
+ 2017-10-04 815cad3ed0 [release-branch.go1.9] doc/1.9: add mention of net/http.LocalAddrContextKey
+ 2017-10-04 1900d34a10 [release-branch.go1.9] net/smtp: fix PlainAuth to refuse to send passwords to non-TLS servers
+ 2017-10-04 a39bcecea6 [release-branch.go1.9] cmd/go: reject update of VCS inside VCS
+ 2017-10-04 d9e64910af [release-branch.go1.9] runtime: deflake TestPeriodicGC
+ 2017-09-28 adc1f587ac [dev.boringcrypto] misc/boring: add src releases
+ 2017-09-25 4038503543 [dev.boringcrypto] misc/boring: add go1.8.3b4
+ 2017-09-25 d724c60b4d [dev.boringcrypto] misc/boring: update README
+ 2017-09-22 70bada9db3 [dev.boringcrypto] misc/boring: add go1.9b4 release
+ 2017-09-22 e6ad24cde7 [dev.boringcrypto] all: merge go1.9 into dev.boringcrypto
+ 2017-09-22 431e071eed [dev.boringcrypto] misc/boring: add go1.9rc2b4 release
+ 2017-09-22 cc6e26b2e1 [dev.boringcrypto] api: add crypto/x509.VerifyOptions.IsBoring to make release builder happy
+ 2017-09-22 bac02b14b5 [dev.boringcrypto] misc/boring: update VERSION
+ 2017-09-22 3ed08db261 [dev.boringcrypto] crypto/tls/fipsonly: new package to force FIPS-allowed TLS settings
+ 2017-09-20 2ba76155cd [dev.boringcrypto] crypto/internal/boring: fix finalizer-induced crashes
+ 2017-09-18 32dc9b247f [dev.boringcrypto] cmd/go: exclude SysoFiles when using -msan
+ 2017-09-18 9f025cbdeb [dev.boringcrypto] crypto/internal/boring: fall back to standard crypto when using -msan
+ 2017-09-18 89ba9e3541 [dev.boringcrypto] crypto/aes: panic on invalid dst, src overlap
+ 2017-09-18 a929f3a04d [dev.boringcrypto] crypto/rsa: fix boring GenerateKey to set non-nil Precomputed.CRTValues
+ 2017-09-18 aa4a4a80ff [dev.boringcrypto] crypto/internal/boring: fix detection of tests to allow *.test and *_test
+ 2017-09-18 c9e2d9eb06 [dev.boringcrypto] crypto/rsa: add test for, fix observable reads from custom randomness
+ 2017-09-18 e773ea9aa3 [dev.boringcrypto] crypto/hmac: add test for Write/Sum after Sum
+ 2017-09-18 8fa8f42cb3 [dev.boringcrypto] crypto/internal/boring: allow hmac operations after Sum
+ 2017-09-18 07f6ce9d39 [dev.boringcrypto] crypto/internal/boring: handle RSA verification of short signatures
+ 2017-09-14 e8eec3fbdb [dev.boringcrypto] cmd/compile: refine BoringCrypto kludge
+ 2017-08-30 7b49445d0f [dev.boringcrypto] cmd/compile: hide new boring fields from reflection
+ 2017-08-30 81b9d733b0 [dev.boringcrypto] crypto/hmac: test empty key
+ 2017-08-30 f6358bdb6c [dev.boringcrypto] crypto/internal/boring: fix NewHMAC with empty key
+ 2017-08-30 9c307d8039 [dev.boringcrypto] crypto/internal/cipherhw: fix AESGCMSupport for BoringCrypto
+ 2017-08-26 f48a9fb815 [dev.boringcrypto] misc/boring: release packaging
+ 2017-08-25 94fb8224b2 [dev.boringcrypto] crypto/internal/boring: disable for android & non-cgo builds
+ 2017-08-25 7ff9fcafbd [dev.boringcrypto] crypto/internal/boring: clear "executable stack" bit from syso
+ 2017-08-24 c8aec4095e [release-branch.go1.9] go1.9
+ 2017-08-24 b8c9ef9f09 [release-branch.go1.9] doc: add go1.9 to golang.org/project
+ 2017-08-24 136f4a6b2a [release-branch.go1.9] doc: document go1.9
+ 2017-08-24 867be4c60c [release-branch.go1.9] doc/go1.9: fix typo in Moved GOROOT
+ 2017-08-24 d1351fbc31 [dev.boringcrypto] cmd/link: allow internal linking for crypto/internal/boring
+ 2017-08-24 991652dcf0 [dev.boringcrypto] cmd/link: work around DWARF symbol bug
+ 2017-08-22 9a4e7942ea [release-branch.go1.9] cmd/compile: remove gc.Sysfunc calls from 387 backend
+ 2017-08-22 ff38035a62 [release-branch.go1.9] doc/go1.9: fix typo in crypto/x509 of "Minor changes to the library".
+ 2017-08-19 7e9e3a06cb [dev.boringcrypto] crypto/rsa: use BoringCrypto
+ 2017-08-19 bc38fda367 [dev.boringcrypto] crypto/ecdsa: use unsafe.Pointer instead of atomic.Value
+ 2017-08-18 42046e8989 [release-branch.go1.9] runtime: fix false positive race in profile label reading
+ 2017-08-18 fbf7e1f295 [release-branch.go1.9] testing: don't fail all tests after racy test failure
+ 2017-08-18 21312a4b5e [release-branch.go1.9] cmd/dist: update deps.go for current dependencies
+ 2017-08-18 5927854f7d [release-branch.go1.9] cmd/compile: add rules handling unsigned div/mod by constant 1<<63
+ 2017-08-18 65717b2dca [release-branch.go1.9] runtime: fix usleep by correctly setting nanoseconds parameter for pselect6
+ 2017-08-17 b1f201e951 [dev.boringcrypto] crypto/ecdsa: use BoringCrypto
+ 2017-08-17 2efded1cd2 [dev.boringcrypto] crypto/tls: use TLS-specific AES-GCM mode if available
+ 2017-08-17 335a0f87bf [dev.boringcrypto] crypto/aes: implement TLS-specific AES-GCM mode from BoringCrypto
+ 2017-08-17 8d05ec9e58 [dev.boringcrypto] crypto/aes: use BoringCrypto
+ 2017-08-17 74e33c43e9 [dev.boringcrypto] crypto/hmac: use BoringCrypto
+ 2017-08-17 96d6718e4f [dev.boringcrypto] crypto/sha1,sha256,sha512: use BoringCrypto
+ 2017-08-17 e0e2bbdd00 [dev.boringcrypto] runtime/race: move TestRaceIssue5567 from sha1 to crc32
+ 2017-08-17 fe02ba30f1 [dev.boringcrypto] crypto/rand: use BoringCrypto
+ 2017-08-17 6e70f88f84 [dev.boringcrypto] crypto/internal/boring: add initial BoringCrypto access
+ 2017-08-16 dcdcc38440 [dev.boringcrypto] add README.boringcrypto.md, update VERSION
+ 2017-08-16 19b89a22df [dev.boringcrypto] cmd/link: implement R_X86_64_PC64 relocations
+ 2017-08-07 048c9cfaac [release-branch.go1.9] go1.9rc2
+ 2017-08-07 cff0de3da3 [release-branch.go1.9] all: merge master into release-branch.go1.9
+ 2017-07-31 196492a299 [release-branch.go1.9] runtime: map bitmap and spans during heap initialization
+ 2017-07-31 1a6d87d4bf [release-branch.go1.9] runtime: fall back to small mmaps if we fail to grow reservation
+ 2017-07-27 7320506bc5 [release-branch.go1.9] cmd/dist: skip moved GOROOT on Go's Windows builders when not sharding tests
+ 2017-07-24 65c6c88a94 [release-branch.go1.9] go1.9rc1
+ 2017-07-24 fbc9b49790 [release-branch.go1.9] cmd/compile: consider exported flag in namedata
Change-Id: I5344e8e4813a9a0900f6633499a3ddf22895a4d5
diff --git a/AUTHORS b/AUTHORS
index e2c8150..64ecb00 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1279,6 +1279,7 @@
Shinji Tanaka <shinji.tanaka@gmail.com>
Shintaro Kaneko <kaneshin0120@gmail.com>
Shivakumar GN <shivakumar.gn@gmail.com>
+Shuai Tan <hopehook.com@gmail.com> <hopehook@qq.com>
Silvan Jegen <s.jegen@gmail.com>
Simon Jefford <simon.jefford@gmail.com>
Simon Rawet <simon@rawet.se>
@@ -1428,6 +1429,7 @@
Wade Simmons <wade@wades.im>
Wander Lairson Costa <wcosta@mozilla.com>
Wayne Ashley Berry <wayneashleyberry@gmail.com>
+Wayne Zuo <wdvxdr1123@gmail.com> <wdvxdr@golangcn.org>
Weaveworks
Wèi Cōngruì <crvv.mail@gmail.com>
Wei Fu <fhfuwei@163.com>
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ea8b1b9..0196b31 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -989,7 +989,6 @@
GitHub User @hengwu0 (41297446) <41297446+hengwu0@users.noreply.github.com>
GitHub User @hitzhangjie (3725760) <hit.zhangjie@gmail.com>
GitHub User @hkhere (33268704) <33268704+hkhere@users.noreply.github.com>
-GitHub User @hopehook (7326168) <hopehook.com@gmail.com>
GitHub User @hqpko (13887251) <whaibin01@hotmail.com>
GitHub User @Illirgway (5428603) <illirgway@gmail.com>
GitHub User @itchyny (375258) <itchyny@hatena.ne.jp>
@@ -2451,6 +2450,7 @@
Shivashis Padhi <shivashispadhi@gmail.com>
Shoshin Nikita <shoshin_nikita@fastmail.com>
Shota Sugiura <s.shota.710.3506@gmail.com>
+Shuai Tan <hopehook.com@gmail.com> <hopehook@qq.com>
Shubham Sharma <shubham.sha12@gmail.com>
Shuhei Takahashi <nya@chromium.org>
Shun Fan <sfan@google.com>
@@ -2735,6 +2735,7 @@
Wang Xuerui <git@xen0n.name>
Warren Fernandes <warren.f.fernandes@gmail.com>
Wayne Ashley Berry <wayneashleyberry@gmail.com>
+Wayne Zuo <wdvxdr1123@gmail.com> <wdvxdr@golangcn.org>
Wedson Almeida Filho <wedsonaf@google.com>
Weerasak Chongnguluam <singpor@gmail.com>
Wèi Cōngruì <crvv.mail@gmail.com>
diff --git a/README.boringcrypto.md b/README.boringcrypto.md
deleted file mode 100644
index 54adda6..0000000
--- a/README.boringcrypto.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# dev.boringcrypto branch
-
-We have been working inside Google on a fork of Go that uses
-BoringCrypto (the core of [BoringSSL][]) for various crypto
-primitives, in furtherance of some [work related to FIPS 140-2][sp].
-We have heard that some external users of Go would be interested in
-this code as well, so this branch holds the patches to make Go use
-BoringCrypto.
-
-[BoringSSL]: https://boringssl.googlesource.com/boringssl/
-[sp]: https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp3678.pdf
-
-Unlike typical dev branches, we do not intend any eventual merge of
-this code into the master branch. Instead we intend to maintain in
-this branch the latest release plus BoringCrypto patches.
-
-To be clear, we are not making any statements or representations about
-the suitability of this code in relation to the FIPS 140-2 standard.
-Interested users will have to evaluate for themselves whether the code
-is useful for their own purposes.
diff --git a/api/next/43724.txt b/api/next/43724.txt
new file mode 100644
index 0000000..1030a80
--- /dev/null
+++ b/api/next/43724.txt
@@ -0,0 +1,2 @@
+pkg os/exec, type Cmd struct, Err error #43724
+pkg os/exec, var ErrDot error #43724
diff --git a/codereview.cfg b/codereview.cfg
index 4157a72..77a74f1 100644
--- a/codereview.cfg
+++ b/codereview.cfg
@@ -1,2 +1 @@
-branch: dev.boringcrypto
-parent-branch: master
+branch: master
diff --git a/misc/boring/README.md b/misc/boring/README.md
deleted file mode 100644
index 4153345..0000000
--- a/misc/boring/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# README.md
-
-This directory holds build scripts for unofficial, unsupported
-distributions of Go+BoringCrypto.
-
-## Version strings
-
-The distribution name for a Go+BoringCrypto release has the form `<GoVersion>b<BoringCryptoVersion>`,
-where `<GoVersion>` is the Go version the release is based on, and `<BoringCryptoVersion>` is
-an integer that increments each time there is a new release with different BoringCrypto bits.
-The `<BoringCryptoVersion>` is stored in the `VERSION` file in this directory.
-
-For example, the first release is based on Go 1.8.3 is `go1.8.3b1`.
-If the BoringCrypto bits are updated, the next would be `go1.8.3b2`.
-If, after that, Go 1.9 is released and the same BoringCrypto code added to it,
-that would result in `go1.9b2`. There would likely not be a `go1.9b1`,
-since that would indicate Go 1.9 with the older BoringCrypto code.
-
-## Releases
-
-The `build.release` script prepares a binary release and publishes it in Google Cloud Storage
-at `gs://go-boringcrypto/`, making it available for download at
-`https://go-boringcrypto.storage.googleapis.com/<FILE>`.
-The script records each published release in the `RELEASES` file in this directory.
-
-The `build.docker` script, which must be run after `build.release`, prepares a Docker image
-and publishes it on Google Artifact Registry.
-`go1.17.2b7` is published as `us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.17.2b7`.
-
-## Release process
-
-Development is done on the dev.boringcrypto branch, which tracks
-master. Releases are cut from dev.boringcrypto.go1.X branches,
-which are BoringCrypto backported to the Go 1.X release branches.
-To issue new BoringCrypto releases based on Go 1.X:
-
-1. If the BoringCrypto bits have been updated, increment the
- number in `VERSION`, send that change out as a CL for review,
- get it committed to dev.boringcrypto, and run `git sync`.
-
-2. Change to the dev.boringcrypto.go1.X branch and cherry-pick
- all BoringCrypto updates, including the update of the
- `VERSION` file. If desired, merge release-branch.go1.X into
- dev.boringcrypto.go1.X. Mail them out and get them committed.
-
-3. **Back on the dev.boringcrypto branch**, run `git fetch`,
- `make.bash` and then `build.release dev.boringcrypto.go1.X`.
- The script will determine the base Go version and the
- BoringCrypto version, build a release, and upload it.
-
-4. Run `build.docker`, which will build and upload a Docker image
- from the latest release.
-
-5. Send out a CL with the updated `RELEASES` file and get it
- committed to dev.boringcrypto.
-
-## Building from Docker
-
-A Dockerfile that starts with `FROM golang:1.17.2` can switch
-to `FROM us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.17.2b7`
-and should need no other modifications.
-
-## Building from Bazel
-
-Starting from [bazelbuild/rules_go](https://github.com/bazelbuild/rules_go)
-tag 0.7.1, simply download the BoringCrypto-enabled Go SDK using
-`go_download_sdk()` before calling `go_register_toolchains()`.
-
-For example, to use Go 1.9.3 with BoringCrypto on Linux, use the following lines
-in `WORKSPACE`:
-```python
-load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_download_sdk", "go_register_toolchains")
-
-go_rules_dependencies()
-
-go_download_sdk(
- name = "go_sdk",
- sdks = {
- "linux_amd64": ("go1.9.3b4.linux-amd64.tar.gz", "db1997b2454a2f27669b849d2d2cafb247a55128d53da678f06cb409310d6660"),
- },
- urls = ["https://storage.googleapis.com/go-boringcrypto/{}"],
-)
-
-go_register_toolchains()
-```
-
-**Note**: you must *not* enable `pure` mode, since cgo must be enabled. To
-ensure that binaries are linked with BoringCrypto, you can set `pure = "off"` on
-all relevant `go_binary` rules.
-
-## Caveat
-
-BoringCrypto is used for a given build only in limited circumstances:
-
- - The build must be GOOS=linux, GOARCH=amd64.
- - The build must have cgo enabled.
- - The android build tag must not be specified.
- - The cmd_go_bootstrap build tag must not be specified.
-
-The version string reported by `runtime.Version` does not indicate that BoringCrypto
-was actually used for the build. For example, linux/386 and non-cgo linux/amd64 binaries
-will report a version of `go1.8.3b2` but not be using BoringCrypto.
-
-To check whether a given binary is using BoringCrypto, run `go tool nm` on it and check
-that it has symbols named `*_Cfunc__goboringcrypto_*`.
-
-The program [rsc.io/goversion](https://godoc.org/rsc.io/goversion) will report the
-crypto implementation used by a given binary when invoked with the `-crypto` flag.
diff --git a/misc/boring/RELEASES b/misc/boring/RELEASES
deleted file mode 100644
index 800b40e..0000000
--- a/misc/boring/RELEASES
+++ /dev/null
@@ -1,187 +0,0 @@
-# This file lists published Go+BoringCrypto releases.
-# Each line describes a single release: <version> <git commit> <target> <URL> <sha256sum>
-go1.9rc2b2 91753387bdf7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9rc2b2.linux-amd64.tar.gz 59355a45e6970e8013060851ddb3f079afe8db52e90db520a0826a13f1b5ae5b
-go1.8.3b3 f6ff81bac156 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.8.3b3.linux-amd64.tar.gz 6287ad971cd268bb2684fb8b1275dea928ad527823062bc057e73036c419e7af
-go1.9rc2b4 c339bc4e07a6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9rc2b4.linux-amd64.tar.gz a8f677d48dc93920065fca4dca1a55bf7110aba132489c47e25d26d55c67eb32
-go1.9b4 e6ad24cde71e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9b4.linux-amd64.tar.gz 6592e36a05df8e7c59812328a3a4bfa6c4eed72132fc31245951c3ade3ef2a8a
-go1.9b4 e6ad24cde71e src https://go-boringcrypto.storage.googleapis.com/go1.9b4.src.tar.gz c85f31dc743fee0e8ce0c6ffc286e27c1f51b66c9b923afafb43cdc378a41091
-go1.8.3b4 42cb4dcdb59a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.8.3b4.linux-amd64.tar.gz 4011c86e6175925e1c63dc7c19a51f825be53bbe7b08260918e5107b0fbd4f85
-go1.8.3b4 42cb4dcdb59a src https://go-boringcrypto.storage.googleapis.com/go1.8.3b4.src.tar.gz 2531ca8918aa024aed8f4a6c9e5c3b25bc8777623f1efa66aec7214601d474e4
-go1.9.2b4 cda3c6f91d7c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.2b4.linux-amd64.tar.gz 7c5e9a033ddc3ab36646e3bac7fd16962742710c70c18122e44a9ab56cdd3cf7
-go1.9.2b4 cda3c6f91d7c src https://go-boringcrypto.storage.googleapis.com/go1.9.2b4.src.tar.gz 38a2260b64a6a5ab20f8972d08b4765bad116721356433f39aebd29c7598218c
-go1.9.3b4 f4e5ebdf35c8 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.3b4.linux-amd64.tar.gz db1997b2454a2f27669b849d2d2cafb247a55128d53da678f06cb409310d6660
-go1.9.3b4 f4e5ebdf35c8 src https://go-boringcrypto.storage.googleapis.com/go1.9.3b4.src.tar.gz 7485e1fc53a9fab9cf34f71de74d69f4c50f9d11a449647de40ee04b59bf8a5b
-go1.9.7b4 0bad1bef406e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.7b4.linux-amd64.tar.gz 9e33a0deb8fed3bd7fa3d122bb5143be9e0a974a422ab4ddac5e765fa1310a6f
-go1.9.7b4 0bad1bef406e src https://go-boringcrypto.storage.googleapis.com/go1.9.7b4.src.tar.gz ad9fb6e22a27382c468467ecade4937f725b33818852f1c1da0d09b471e7486c
-go1.10.3b4 35ba5284935c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.3b4.linux-amd64.tar.gz 6754729d78a375bd1debd980b1e3e7fd49198a980d0bbd8f39e89569aa001942
-go1.10.3b4 35ba5284935c src https://go-boringcrypto.storage.googleapis.com/go1.10.3b4.src.tar.gz f3e75c60a835c11b97e30429b63917ceb31f799b2ba7e2001d99db908fb8e28f
-go1.10.4b4 2e2a04a605b6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.4b4.linux-amd64.tar.gz 17c275ff448686fe1908ecbea5d11ad6f4f7caa288d1786b756439703b12b8b2
-go1.10.4b4 2e2a04a605b6 src https://go-boringcrypto.storage.googleapis.com/go1.10.4b4.src.tar.gz f9cc38e194edabebf338fb74c22f597dc847560618d5d7d4d6cdc28139efa772
-go1.11b4 685dc1638240 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11b4.linux-amd64.tar.gz d53417b2071af0104fbc15a957000bccdcb5bbc094df0401f67d51968f7f2e4e
-go1.11b4 685dc1638240 src https://go-boringcrypto.storage.googleapis.com/go1.11b4.src.tar.gz 39896f0decd6721e81324cb2bb19540706ca97152c6800a6c8ad15a4e4162184
-go1.11.2b4 35cf0d9f6bbd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.2b4.linux-amd64.tar.gz a9ceb6d0b4413d81ccc94c6460f60ca0c4f36b5dcbf659e1be582cd40c0edfbd
-go1.11.2b4 35cf0d9f6bbd src https://go-boringcrypto.storage.googleapis.com/go1.11.2b4.src.tar.gz 8e12a8df1428f00239dc67dd438a81f72c9925982e90b6899f66270971bddc1c
-go1.10.7b4 8b246fe0f595 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.7b4.linux-amd64.tar.gz 31917ab96004b9b482399b46928f5c10cdadefed5fda6f4de262efe2c3c7533e
-go1.10.7b4 8b246fe0f595 src https://go-boringcrypto.storage.googleapis.com/go1.10.7b4.src.tar.gz 323a184c77e3a377f5ed993b04946ee7b1a8e3350aba2894c0944f1e313636f1
-go1.11.4b4 572c4bce6792 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.4b4.linux-amd64.tar.gz e708ef7ecaf17a3e8e6deceadfa167cc1162f710f97ea4bc124d3837d6e2eaa1
-go1.11.4b4 572c4bce6792 src https://go-boringcrypto.storage.googleapis.com/go1.11.4b4.src.tar.gz ea963b80e218a34470e14e6e997fe06b8c5bf3f9c9bb0c801f7d8ef63b9bcb73
-go1.10.8b4 4b76b996cb0a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.8b4.linux-amd64.tar.gz 6d7d3323030851b595ba7ed66931c352b63de6dfe1ab3e6d6243987765d09819
-go1.10.8b4 4b76b996cb0a src https://go-boringcrypto.storage.googleapis.com/go1.10.8b4.src.tar.gz c1f5df50a4be3d0cb3aed7b80728f2b23c18deff0383636274742a38c145f939
-go1.11.5b4 3fb9dafacc45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.5b4.linux-amd64.tar.gz 9b5b2972b452da9ba6bba65bab18fb9e8fbda31b5c489275710e5429d76f568c
-go1.11.5b4 3fb9dafacc45 src https://go-boringcrypto.storage.googleapis.com/go1.11.5b4.src.tar.gz 1c5801e2af25c9299d9fd94c64f9ec11fd35777c45d5d0f398c0a9884b1cfbbf
-go1.12.1b4 88e20e81a61f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.1b4.linux-amd64.tar.gz b71886e0d65e5efea2e0a3cbd0c3cd0daf84c437078e755ecde25f4ac0bbed2f
-go1.12.1b4 88e20e81a61f src https://go-boringcrypto.storage.googleapis.com/go1.12.1b4.src.tar.gz d44be1396eb2854b5d9c4d8e8ed0cf9fea1e9dc5a02d8f53b41ba571951a329f
-go1.11.6b4 7be8a5843a9b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.6b4.linux-amd64.tar.gz b704f61b8979e64a46da8884c90cd2b0e2d54e802d55e5f56d7c93752334c197
-go1.11.6b4 7be8a5843a9b src https://go-boringcrypto.storage.googleapis.com/go1.11.6b4.src.tar.gz a56b45e24b61ad7b3c90dfd906cd22426a4de9e2e697b4c9ef07a2af047bcb0d
-go1.12.5b4 ad495d31d908 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.5b4.linux-amd64.tar.gz df0e64958cf90f27a65b2175eb80bc34a601136eed8e5559bed2a9e349e33707
-go1.12.5b4 ad495d31d908 src https://go-boringcrypto.storage.googleapis.com/go1.12.5b4.src.tar.gz 054d482896a77ae2d7d24c7adf08da5a4401b938871e61a5cdabc735c54cea9f
-go1.11.11b4 346babe6a67f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.11b4.linux-amd64.tar.gz c4dd44fa00f491b3d2ea808af8a6c234f915adb27c014512d725bafc4784d75f
-go1.11.11b4 346babe6a67f src https://go-boringcrypto.storage.googleapis.com/go1.11.11b4.src.tar.gz 57a724a72f0ba8620cbb48288f39c86ed513c241509ddf73231f4c8cd2a983ac
-go1.12.6b4 6b86b09ad4d3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.6b4.linux-amd64.tar.gz eebc2e7f37555760adb361985b861d0cd34f9401cf7456d8d2f2f3082a60eee1
-go1.12.6b4 6b86b09ad4d3 src https://go-boringcrypto.storage.googleapis.com/go1.12.6b4.src.tar.gz 0e6e9aaf2c72a7e61280ce1e77b2ea24f01a59f4c1e6f0aa72b753206724fd3a
-go1.11.12b4 845e947ae34f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.12b4.linux-amd64.tar.gz 91808261fc357855fba920df01a933d6104e907793014317de00b92802d494d9
-go1.11.12b4 845e947ae34f src https://go-boringcrypto.storage.googleapis.com/go1.11.12b4.src.tar.gz 7b64d9e56ea627138d87c7533df8f9932a79ff900f150a8d8e6a3edc2d0066ec
-go1.12.7b4 bd126d0ad256 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.7b4.linux-amd64.tar.gz 7f0c73cd397bccad48ab4df4188d3651c25bf33102275848c6e67b882e11f680
-go1.12.7b4 bd126d0ad256 src https://go-boringcrypto.storage.googleapis.com/go1.12.7b4.src.tar.gz 0c48d7b81ef2b948980011fad1d176d6b10636a4016e3aed7438d86e046d816b
-go1.11.13b4 4f8e7223f936 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.13b4.linux-amd64.tar.gz eeb232577065732f5d57a4c77b7d73aa60231ee6fd6496daf7558993e92e403f
-go1.11.13b4 4f8e7223f936 src https://go-boringcrypto.storage.googleapis.com/go1.11.13b4.src.tar.gz 107da8846803a0a735766ca0947de6cd15cd23d8c584002f06e7ac5f81ecb114
-go1.12.8b4 55186ba70c1a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.8b4.linux-amd64.tar.gz 63f278abfc1e98546bc0ffc87f000d9aae2b06c0700212cb55ffd17d059fb8e1
-go1.12.8b4 55186ba70c1a src https://go-boringcrypto.storage.googleapis.com/go1.12.8b4.src.tar.gz c12b1d56ba4e0572f85a08681e05c66293ad53f04b11ce74c688d78fcb882061
-go1.12.9b4 ee88e5b118b5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.9b4.linux-amd64.tar.gz d90989cba1db647b795400a9520eab2fa30f8dea50f4189b18d53f757a4bac44
-go1.12.9b4 ee88e5b118b5 src https://go-boringcrypto.storage.googleapis.com/go1.12.9b4.src.tar.gz 9d4efed8e13fa5ebdadd4fc22f9e35e67bfb34322570c83a15a0879472412e13
-go1.13b4 28e8a0c21e00 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13b4.linux-amd64.tar.gz 4a909f34bc487badb5ec11646c471ae690393d3f7835b8fbef8466d04ee23cba
-go1.13b4 28e8a0c21e00 src https://go-boringcrypto.storage.googleapis.com/go1.13b4.src.tar.gz 3c2dbe1bfcd7299b5be4b75529425c0a67b8d6b76f81f993b84ae0d173934257
-go1.12.10b4 5827153a1db7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.10b4.linux-amd64.tar.gz 20963fde89fd20eebee9d89003e52702f0379fdb04a68754f9fadf2c302166e3
-go1.12.10b4 5827153a1db7 src https://go-boringcrypto.storage.googleapis.com/go1.12.10b4.src.tar.gz f5cfe73cfeaaa67619ff4a4bbc587e622d63a6aaa7145253e6583bd59072b323
-go1.13.1b4 2da1832ad494 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.1b4.linux-amd64.tar.gz 70be1bae05feb67d0560f39767e80707343d96554c5a611fbb93b04ce5913693
-go1.13.1b4 2da1832ad494 src https://go-boringcrypto.storage.googleapis.com/go1.13.1b4.src.tar.gz cf94520325f376ecaf420b7d25756cdecbed52510a1a079eca67c2c86c3cf39b
-go1.12.11b4 c5a4ae8c8c1b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.11b4.linux-amd64.tar.gz a2d90aa130d45b36dd94a7e70accc94e2585eb45823fb7b07ae182ac8bc4a8ca
-go1.12.11b4 c5a4ae8c8c1b src https://go-boringcrypto.storage.googleapis.com/go1.12.11b4.src.tar.gz c334b70c9af0380fb9d397e89af1e2e2ac03380b5cc7c3327f56536c2f68bf8d
-go1.13.2b4 6a1c22797f9c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.2b4.linux-amd64.tar.gz 888c1f6331862af388e730fab4926aa1cb2d4ffc5417e32f9e6d2af7953f0e29
-go1.13.2b4 6a1c22797f9c src https://go-boringcrypto.storage.googleapis.com/go1.13.2b4.src.tar.gz fc44c7713fcd84fe0587594ae5ee1a1d318a0da18b1156e1f9645c6ffa0335bc
-go1.12.12b4 cab2e4707a42 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.12b4.linux-amd64.tar.gz 983e996e8f60c78a400fed0edfd16c1718d704e15389c48b4a8b2d835c0d00f2
-go1.12.12b4 cab2e4707a42 src https://go-boringcrypto.storage.googleapis.com/go1.12.12b4.src.tar.gz 2d653a74c14cde1e414ac558e0bdd182ccbe1198bbff8cd22c8e423552d5e24d
-go1.13.3b4 cba6efa89376 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.3b4.linux-amd64.tar.gz 9ba0b7696f14dc7ecc912aae6587491853637fab30c4c005339fe36751bfd185
-go1.13.3b4 cba6efa89376 src https://go-boringcrypto.storage.googleapis.com/go1.13.3b4.src.tar.gz ba83d7e18fa49dc6e4319806e7b5cdee5eb046eb8e9fb38f3034378c4f80944a
-go1.12.13b4 5d9d84d037da linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.13b4.linux-amd64.tar.gz af3e0d2b9996c632b010da6700b7b8ec52bd3065b3facc478709209a854664eb
-go1.12.13b4 5d9d84d037da src https://go-boringcrypto.storage.googleapis.com/go1.12.13b4.src.tar.gz d1bae336ea076a0b2bfc984477f4a216a475e134068227e6d9b44faf239bcfb8
-go1.13.4b4 fa3f24e5c294 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.4b4.linux-amd64.tar.gz 23579d1bea65b2510e507bb0698ec66777bd34674c91dfe617ed130728791dc7
-go1.13.4b4 fa3f24e5c294 src https://go-boringcrypto.storage.googleapis.com/go1.13.4b4.src.tar.gz 8d82df5b4332acd5a274ac029ee5b5ff073b2a4247e2325610986221858b819d
-go1.12.16b4 f74e68136cf1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.16b4.linux-amd64.tar.gz fd70cee8ca9438f99cc71b3586b11a03a36239a5bccbf1c4d06e7206b88bd77d
-go1.12.16b4 f74e68136cf1 src https://go-boringcrypto.storage.googleapis.com/go1.12.16b4.src.tar.gz 2ae0823cefc34f280d4f4ba0d665ff247ba1429cb43198d10e3bc316d3f29a8d
-go1.13.7b4 71468339f763 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.7b4.linux-amd64.tar.gz 85945502ad43f506902927f69b514b34a85a20e2bd1020cce87c551645194aa3
-go1.13.7b4 71468339f763 src https://go-boringcrypto.storage.googleapis.com/go1.13.7b4.src.tar.gz d30fa252de75763adb5886125e19e8bab68dbe8dbad33b0faf09a6be98b12d96
-go1.12.17b4 9e5b1367cb45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.17b4.linux-amd64.tar.gz ee3a72dc1cfd8a34f32aaa5ddb05076fcb39434fd1bd25aa318234f72b462e31
-go1.12.17b4 9e5b1367cb45 src https://go-boringcrypto.storage.googleapis.com/go1.12.17b4.src.tar.gz ffb653ec8f4cc33e1e7c308d89c695f322a76f3107e0fc8c639affc6148261bf
-go1.13.8b4 fdf5e5b5905f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.8b4.linux-amd64.tar.gz eac505df92aa6d6b76041f4b485d230f839159b8567c96d7980a06ef476ab3df
-go1.13.8b4 fdf5e5b5905f src https://go-boringcrypto.storage.googleapis.com/go1.13.8b4.src.tar.gz 1aa28fe37a704e94bb34e23578fd07ebbc6a025e9be9b45a898967b84405c41b
-go1.14b4 99da8fa53467 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14b4.linux-amd64.tar.gz a617e03a6c8813c53b813b865a2e185e12dbfaa76c703c1c48e57ad89651556b
-go1.14b4 99da8fa53467 src https://go-boringcrypto.storage.googleapis.com/go1.14b4.src.tar.gz ee292639b24923f519f1f0fe1ceaeca8d46feb8c15cf88e228346398c5848380
-go1.13.9b4 bb8a1014a32c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.9b4.linux-amd64.tar.gz 565e1a3c62dfc2586471b6ae189ada053a86fc51d88d2eac883a03731071bf77
-go1.13.9b4 bb8a1014a32c src https://go-boringcrypto.storage.googleapis.com/go1.13.9b4.src.tar.gz 536f0549e7bbdad32270a17d8a282667560b6da2d27a5e3580714338e70185ad
-go1.14.1b4 e784c3f4d925 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.1b4.linux-amd64.tar.gz 6570991396d531fb628e4c01d697eeee395104147d406aec5a8ba00a213ef63f
-go1.14.1b4 e784c3f4d925 src https://go-boringcrypto.storage.googleapis.com/go1.14.1b4.src.tar.gz 2c267c3114fa4683f51c281d216d3754b38d5d08144c3acc318cf37165b1b2da
-go1.13.10b4 b129f40bb33f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.10b4.linux-amd64.tar.gz a511b2e6ee7b71ca1411d6e4bb07ec33bb5b6974fd1dded77e00520d24d9d000
-go1.13.10b4 b129f40bb33f src https://go-boringcrypto.storage.googleapis.com/go1.13.10b4.src.tar.gz 5dfa44eea19b0be0c9c394fbbf89b2a14f84380a9d7b87e21eacba3ba030c44b
-go1.14.2b4 2b0d842f4b24 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.2b4.linux-amd64.tar.gz 82449a7ce57733c0cd3fa7feac89214706ff2b04e387b62619b8e2b8b388ffd9
-go1.14.2b4 2b0d842f4b24 src https://go-boringcrypto.storage.googleapis.com/go1.14.2b4.src.tar.gz bfcb44fa329d6a2eb5c4ef58bfa114d65b078bf69a361bb77e3ea52ec8975d14
-go1.13.12b4 488ca930b24a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.12b4.linux-amd64.tar.gz 63193aa2290af5d65d2d6bbddcd11d835d437a4e835954d605863f5b27a7661d
-go1.13.12b4 488ca930b24a src https://go-boringcrypto.storage.googleapis.com/go1.13.12b4.src.tar.gz 5b0aefb44ba2a08fedb5be0144810bc47559d7d8a6e61638c09dd261706d650e
-go1.14.4b4 fcdb6aa6ee5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.4b4.linux-amd64.tar.gz 682f2167b3d619690b1385196776822b1d2c497607f67e2d19d92faf2bea0b4a
-go1.14.4b4 fcdb6aa6ee5d src https://go-boringcrypto.storage.googleapis.com/go1.14.4b4.src.tar.gz 2fb759023360f0d42ba434f0409da2460ff4386cab062557f97fe15122b4b4cd
-go1.13.14b4 852ccd9de7d1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.14b4.linux-amd64.tar.gz 49c67d3a67fac60e18a264555392aa5925126a75ef0ba152ec315cc874eccb43
-go1.13.14b4 852ccd9de7d1 src https://go-boringcrypto.storage.googleapis.com/go1.13.14b4.src.tar.gz 7b7dfc62286a07d438370b09f38845acae99c592c6e147722b8f3c098ab8756a
-go1.14.6b4 8f53ffb15fd5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.6b4.linux-amd64.tar.gz 953322287806a42d4a73e096aea45511a51a0a323086e98119edcb0dae866c9d
-go1.14.6b4 8f53ffb15fd5 src https://go-boringcrypto.storage.googleapis.com/go1.14.6b4.src.tar.gz 75fea7a60da4ca225473b500b2d5ce7c302ca7d22eedfdbd3444cd01e6b9f392
-go1.15b5 a15df605fc4a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15b5.linux-amd64.tar.gz ebcb2212bdb645a16ffc05a1d9b77c94553ed19a6ccbbc73e4868c64777eb70a
-go1.15b5 a15df605fc4a src https://go-boringcrypto.storage.googleapis.com/go1.15b5.src.tar.gz 7107665853228b2c18f56fec73e217fa3494ccf52c609be839cf6945d501c0f0
-go1.13.15b4 5622128a77b4 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.15b4.linux-amd64.tar.gz 8b45ec0e578dc0a0bc483c2d12c08fee5adbfb39f0854fbe9d45f7d628ed1697
-go1.13.15b4 5622128a77b4 src https://go-boringcrypto.storage.googleapis.com/go1.13.15b4.src.tar.gz 21eab29a61a43078cd8bcdbbbb4c82ca049a7e2e211aca0c95f6a306e288db4f
-go1.14.9b4 62cd3338eed7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.9b4.linux-amd64.tar.gz c81946294cbefa7a3abdf47733c720c3454418d6881c137a2e28f18ea40977aa
-go1.14.9b4 62cd3338eed7 src https://go-boringcrypto.storage.googleapis.com/go1.14.9b4.src.tar.gz e9c13c4daa10f6aac80b703f61f7e931af92e92146c8b140ae79e20e4af6bccd
-go1.15.2b5 dbc5602d1839 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.2b5.linux-amd64.tar.gz 30c04d854fc8990017ee8c180c1407a4f26c016e3a4134161bbf41c9d16452e3
-go1.15.2b5 dbc5602d1839 src https://go-boringcrypto.storage.googleapis.com/go1.15.2b5.src.tar.gz 67432c0b0a02aa6cc0c49ab285f1c6935a16dadfebd77dfabca7e31907240bc9
-go1.14.10b4 b5fc12785be4 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.10b4.linux-amd64.tar.gz d3aa38fb5108b43b155c21529190e73789df6ca0b37feafd43438aefe42f936e
-go1.14.10b4 b5fc12785be4 src https://go-boringcrypto.storage.googleapis.com/go1.14.10b4.src.tar.gz daf7603babc49935efdea5befb2ecad823771523a84d1ba6c0e8c10fac982d59
-go1.15.3b5 ed9dc25d693c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.3b5.linux-amd64.tar.gz 34ec7ec094f5e9349f1612b5f6d8f014b3a7b37b6986aeedcd0fe7cf2dc76a62
-go1.15.3b5 ed9dc25d693c src https://go-boringcrypto.storage.googleapis.com/go1.15.3b5.src.tar.gz bc37727287366aabb47594717cebd0a759147d8b2eb4cd3a45a19317af199fe9
-go1.14.12b4 21ba30ad409a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.12b4.linux-amd64.tar.gz 7f9fb67a3c59fff24e3c51fa2a7435f4195cfb33844c9c2def27c162cc23604b
-go1.14.12b4 21ba30ad409a src https://go-boringcrypto.storage.googleapis.com/go1.14.12b4.src.tar.gz 948d7a77a4a890a7258102bcc7b63890f238061dfb6a4c06033660e727e87fcf
-go1.15.5b5 11087322f85d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.5b5.linux-amd64.tar.gz 9c97488137f1f560b3fff0d8a2a9c45d2de8790fb8952a42b46cc4633528fc48
-go1.15.5b5 11087322f85d src https://go-boringcrypto.storage.googleapis.com/go1.15.5b5.src.tar.gz ee933cb1a4b591794dbcce99740032506af25ee202765dcc6979feb5abc114fc
-go1.14.13b4 2bb8e5a94e8a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.13b4.linux-amd64.tar.gz 8fb6e1cefe5535ab704e1b4e26725095dcca0060490842a54dd93e7cd8b206cd
-go1.14.13b4 2bb8e5a94e8a src https://go-boringcrypto.storage.googleapis.com/go1.14.13b4.src.tar.gz 02e0c4871d12813aee1019bf189b77ccec99dab3a1d5b95ce6abdf85b1810703
-go1.15.6b5 f78276931172 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.6b5.linux-amd64.tar.gz 245c500f7da70fb2abd1a6021436ed48e2b97dbbdb394a759b0601dc69cf4e77
-go1.15.6b5 f78276931172 src https://go-boringcrypto.storage.googleapis.com/go1.15.6b5.src.tar.gz 6576a29d019405b14fdc98883fed33c766de2028fbbd3a743a241275275cc7e5
-go1.14.14b4 9cf003256bc3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.14b4.linux-amd64.tar.gz 7df65366d26a13c5be16f87f64e832e86db3b8b9ca1b5c6385e0e20bf79dc82f
-go1.14.14b4 9cf003256bc3 src https://go-boringcrypto.storage.googleapis.com/go1.14.14b4.src.tar.gz aaeda57e2b68ac72783c7aacded814ec660a91c1010c3139156c8e7def86f145
-go1.15.7b5 79ea7a16d7e3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.7b5.linux-amd64.tar.gz cb08962897e3802cda96f4ee915ed20fbde7d5d85e688759ef523d2e6ae44851
-go1.15.7b5 79ea7a16d7e3 src https://go-boringcrypto.storage.googleapis.com/go1.15.7b5.src.tar.gz aa7cb4beff82881cbff4a66e9e07a4004e49384a8fcc95204db9b2f48c12a235
-go1.15.8b5 2a0dd053ecfa linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.8b5.linux-amd64.tar.gz 9d897bf42a962b064cfc9bed182c18ade0a3f5857d6a075d93b73ca8fe3b1f3a
-go1.15.8b5 2a0dd053ecfa src https://go-boringcrypto.storage.googleapis.com/go1.15.8b5.src.tar.gz 57964e7762ab03f0ad17bc787585b1709decccf095b7f7d2e9fca61a71e09010
-go1.14.15b4 47419f9cac61 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.15b4.linux-amd64.tar.gz 82ba7297d26afcdade439de5621bdcb16e5261877f204aa60d03b5e07223a5c8
-go1.14.15b4 47419f9cac61 src https://go-boringcrypto.storage.googleapis.com/go1.14.15b4.src.tar.gz bf77b15f1d905753648db2d91e39c3a740b67b03dfff511aa25a360a78f9742a
-go1.16b7 67a0be0b437e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16b7.linux-amd64.tar.gz 56d4e41d55baece6b98bc66bdf772b0eb17518dd287f27c533225cd154ee0a38
-go1.16b7 67a0be0b437e src https://go-boringcrypto.storage.googleapis.com/go1.16b7.src.tar.gz 7d063cf1cbd252da8b2db54947e5f2f1402ac792e1ea6de76e05ab233f5badbd
-go1.15.9b5 055f1da6e6b9 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.9b5.linux-amd64.tar.gz 8e44de7d9d36d68e01c0454841f1becb93d4932bb16a623ed6d4de15ecba1239
-go1.15.9b5 055f1da6e6b9 src https://go-boringcrypto.storage.googleapis.com/go1.15.9b5.src.tar.gz dba0290da6ae46df8d68c6d027b7d6b4775d6dcf8ff9f3cb8a26dbd5b757e696
-go1.16.1b7 b9bd851b1452 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.1b7.linux-amd64.tar.gz 963f6a4fb8c5ff7668fb17ba52c3d905466058266556844aee79139f7e3c9521
-go1.16.1b7 b9bd851b1452 src https://go-boringcrypto.storage.googleapis.com/go1.16.1b7.src.tar.gz 8e6849010ae5f3280fea0f6fa6e5b07831ac6e6524a636fab41c0e4f77b529ba
-go1.15.10b5 229a39e34717 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.10b5.linux-amd64.tar.gz 7533b0307fd995deb9ef68d67899582c336a3c62387d19d03d10202129e9fad3
-go1.15.10b5 229a39e34717 src https://go-boringcrypto.storage.googleapis.com/go1.15.10b5.src.tar.gz adbaff96b2392a9ab5a20d15fec959983861ec6e554c3c9cd14aec586a0928b3
-go1.16.2b7 6d5f0ffc93e5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.2b7.linux-amd64.tar.gz 2871d90630706eba9d3bd2838ec1c0a367c78c2c4f40e74ed75c294e2c5aa358
-go1.16.2b7 6d5f0ffc93e5 src https://go-boringcrypto.storage.googleapis.com/go1.16.2b7.src.tar.gz 8991c28e30bdd9b34076c2871ab69aac7f306dba08d202aa7301f3adb54ad9f3
-go1.15.11b5 be25192f119e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.11b5.linux-amd64.tar.gz c5aa34a83631b3736bc1ab37027bc4fc22eca2353035586a6255be7e29251f43
-go1.15.11b5 be25192f119e src https://go-boringcrypto.storage.googleapis.com/go1.15.11b5.src.tar.gz 05408824d64ac8ebb6c1d895017e605d45a2c4ebee28995136fe12f4833652d2
-go1.16.3b7 fcee6b930a01 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.3b7.linux-amd64.tar.gz afe15efce3c1fecc60994d7ba0d41daaa029fa5810c98737121dde7b38a5e2ac
-go1.16.3b7 fcee6b930a01 src https://go-boringcrypto.storage.googleapis.com/go1.16.3b7.src.tar.gz 5c86175ed86e6ae3826eb827cc51bdda770f22ffaf3258b11135a268153b5057
-go1.16.4b7 25aff96f4b49 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.4b7.linux-amd64.tar.gz de60f0620f46b1872813f72646fdece76be94f43c1abe84b69033c26f823a31f
-go1.16.4b7 25aff96f4b49 src https://go-boringcrypto.storage.googleapis.com/go1.16.4b7.src.tar.gz 5b537cf5598bc968764885f4d1f9820578d05d104a6cd7107bb3e443217f4983
-go1.15.12b5 03a15201e7e0 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.12b5.linux-amd64.tar.gz 9fadc65da7df036bfe702b3f9980e2ca2b184f13d09e8094244f58a866a2f6ee
-go1.15.12b5 03a15201e7e0 src https://go-boringcrypto.storage.googleapis.com/go1.15.12b5.src.tar.gz 81ec958d893f4ecf90111d09ceb79b36492266a39d1918a22e80443e1d399561
-go1.16.5b7 e4feea2ce841 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.5b7.linux-amd64.tar.gz 2085b246d7d6908f504d0f33c655c31c3ec6e1ae3d13a020ba58abcf1b6ea7a4
-go1.16.5b7 e4feea2ce841 src https://go-boringcrypto.storage.googleapis.com/go1.16.5b7.src.tar.gz cfe6cc16eb205d61414338c2b42fa2c4278831785b29e6b79712669418852ef4
-go1.15.13b5 9647f89f2ac2 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.13b5.linux-amd64.tar.gz 1ad1edeaf3b6bc7696978d4137f55c0b38b8d796a607b89f7f010004aaef60a6
-go1.15.13b5 9647f89f2ac2 src https://go-boringcrypto.storage.googleapis.com/go1.15.13b5.src.tar.gz 6cc9c5d23947a9dccc0e1afdff5d433398b09df1c5170596a826aac326ece457
-go1.15.14b5 ddf078e08dc6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.14b5.linux-amd64.tar.gz 8c4dbdc91e36f3d1db7f14b234973bfcb3b685fe4a6cb2e326ba9cf73a4260c2
-go1.15.14b5 ddf078e08dc6 src https://go-boringcrypto.storage.googleapis.com/go1.15.14b5.src.tar.gz 0022b68f04a5d8553cfd838d3fe226f18e7095194300b2be4fc49a689daf0e1b
-go1.16.6b7 6a6b41a8441e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.6b7.linux-amd64.tar.gz f7f33064643ce0ab8ac1cede100e7eee8509a970178f5be961d9fba331226067
-go1.16.6b7 6a6b41a8441e src https://go-boringcrypto.storage.googleapis.com/go1.16.6b7.src.tar.gz a1079dd2df6aad3bad584c4187dab98a264075b56b1d257ba27d956340ff7bbf
-go1.15.15b5 dd96ded6c86b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.15b5.linux-amd64.tar.gz 719d818f70c6eb1e753910fe21624832cf3f719540f22f89863e959ff68c0001
-go1.15.15b5 dd96ded6c86b src https://go-boringcrypto.storage.googleapis.com/go1.15.15b5.src.tar.gz af2d44c8eef02e093c077c085fbe6964af0ca715f95f4bcea0809fa211cc4ded
-go1.16.7b7 0d02a0d966b6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.7b7.linux-amd64.tar.gz d4ca2906640edd9299d12d8204aae0d848b497b79b92424d8705ae748e16f3c5
-go1.16.7b7 0d02a0d966b6 src https://go-boringcrypto.storage.googleapis.com/go1.16.7b7.src.tar.gz f65503abf459ba1d2f77d4d023fcebd19c62e7c34d3ffd0f1aebb598ffa153d9
-go1.16.9b7 35d5cd0dcfb9 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.9b7.linux-amd64.tar.gz 6659e3ea17474000d2ac2f4a887a4bac26ab8cf6a0b0779cbd41464a7de23645
-go1.16.9b7 35d5cd0dcfb9 src https://go-boringcrypto.storage.googleapis.com/go1.16.9b7.src.tar.gz 81a40da773e33230276446955f9ddc85c8ca121432d56842edad49212975a9bc
-go1.17.2b7 5f1867dc1e67 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.2b7.linux-amd64.tar.gz 60fd88def54b81e489ba2d2d80e5df32150ef1a62c0ece3ff869862141824c81
-go1.17.2b7 5f1867dc1e67 src https://go-boringcrypto.storage.googleapis.com/go1.17.2b7.src.tar.gz b00e746a053d5e70e27151b9461e5e3413c53bb88bc60e0db107a99284614d17
-go1.16.10b7 06a4b2790c5b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.10b7.linux-amd64.tar.gz 9720316c7d91fa0b6a31678745ad68c52c92e4027751602449fb2309c0c3f1de
-go1.16.10b7 06a4b2790c5b src https://go-boringcrypto.storage.googleapis.com/go1.16.10b7.src.tar.gz 742e1e904d82cd7a17fade53ab9001f5f88b7a3ee9358c587811762fc07cdaa3
-go1.17.3b7 5a371e30afcb linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.3b7.linux-amd64.tar.gz a5216d1e7401c734b3e29e8aad3c8608f094ae7d37b55e8815211e25922e4d19
-go1.17.3b7 5a371e30afcb src https://go-boringcrypto.storage.googleapis.com/go1.17.3b7.src.tar.gz 858595a95faf4c730ebe3d40ecba1705b79f7bc2a996fd044cb30da8d9c57534
-go1.17.4b7 95e6359f6a5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.4b7.linux-amd64.tar.gz aa4a69709a08c7d83a6417f978a9e5f32207c0e9da82d39cceff7d9cdf657e59
-go1.17.4b7 95e6359f6a5d src https://go-boringcrypto.storage.googleapis.com/go1.17.4b7.src.tar.gz 0151f947e1da7a9cec63b06276b9ed4b92d2e5113ae254ebbdb9191b65c711f6
-go1.16.11b7 c884bd9ef2f1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.11b7.linux-amd64.tar.gz 8edd1e42a88df0dbb99f1e1487149a856155f24711e19c17ba0f08d76254e2ca
-go1.16.11b7 c884bd9ef2f1 src https://go-boringcrypto.storage.googleapis.com/go1.16.11b7.src.tar.gz a50f8362af1e44011b342657cac80d817868c6d0f40a6d235c45abc81c16fb92
-go1.16.12b7 adecd3ffbec7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.12b7.linux-amd64.tar.gz fd43c36e9bc926634c13e0dc3547046c55f3b5a2448473d8fb51c344ea726542
-go1.16.12b7 adecd3ffbec7 src https://go-boringcrypto.storage.googleapis.com/go1.16.12b7.src.tar.gz 891e21c67738b63b645ace56fbd3874ff9e8583865ee7907543ae43373411d64
-go1.17.5b7 dc52cfcd39cd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.5b7.linux-amd64.tar.gz 92407bbc855fd05c5252a2ee2d4fcb6eb077cf64fd0d70da53ba7914c22ec1d7
-go1.17.5b7 dc52cfcd39cd src https://go-boringcrypto.storage.googleapis.com/go1.17.5b7.src.tar.gz 4c508aecce1b56e34a4e32605086994606c72010b7caedce7681c1019781c93e
-go1.16.13b7 bb93480d0093 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.13b7.linux-amd64.tar.gz cd98a2ea753edc9d0206b14b2d40d269ddaee1dea7bc59b91cb8a11fc575f738
-go1.16.13b7 bb93480d0093 src https://go-boringcrypto.storage.googleapis.com/go1.16.13b7.src.tar.gz e9f8f5f6769fed35924b364f2e1df8ad2fc491569189761047cec14ca5922ee1
-go1.17.6b7 cfad1ff84c45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.6b7.linux-amd64.tar.gz 5b55a001fb80f9baaed621c2469977b9c9afe13b9afc6fd5712057856ab86f5d
-go1.17.6b7 cfad1ff84c45 src https://go-boringcrypto.storage.googleapis.com/go1.17.6b7.src.tar.gz 5178f595dea6d618f7cdf6b9e2346a1a28430b4d547996b766fcd5b34379ca2f
-go1.17.7b7 172559d22b5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.7b7.linux-amd64.tar.gz a69bf0516affb8678873ba40c4ddbc8e3b01bfa8460f5c5f356dd53049d54322
-go1.17.7b7 172559d22b5d src https://go-boringcrypto.storage.googleapis.com/go1.17.7b7.src.tar.gz eff84edf4f676c691ac21747277e15777789be32dcaa53a0779737b280351453
-go1.16.14b7 e90b835f3071 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.14b7.linux-amd64.tar.gz 5024e1231d33b9dfffdd7821132dd32eccd42e7415f25618dc8c7304b335edd9
-go1.16.14b7 e90b835f3071 src https://go-boringcrypto.storage.googleapis.com/go1.16.14b7.src.tar.gz caef2ef601bcc588e6bcb511087c9620200723a4c74191b725fbda94c3be884b
-go1.17.8b7 4ea866a9969f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.8b7.linux-amd64.tar.gz 4a1fa2c8d77309e1ef5bafe7e80e75c06e70c0ae1212d9f3d95485017155491d
-go1.17.8b7 4ea866a9969f src https://go-boringcrypto.storage.googleapis.com/go1.17.8b7.src.tar.gz e42ac342c315d33c47434299a24f33137e7099f278ee6669404c4d7e49e17bcf
-go1.16.15b7 649671b08fbd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.15b7.linux-amd64.tar.gz 4d62f517786266019c721c35330e23da123eb184eadb5a79379fe81d31d856db
-go1.16.15b7 649671b08fbd src https://go-boringcrypto.storage.googleapis.com/go1.16.15b7.src.tar.gz 54fc7f2ec0b72b0aaf7726eb5f7f57885252ef46c2c1ca238090cc57850e3ef7
-go1.18b7 0622ea4d9068 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18b7.linux-amd64.tar.gz baa33bc66b8df97a3c5a328637b85f04d5629f139dc2df946c09ab7214510c61
-go1.18b7 0622ea4d9068 src https://go-boringcrypto.storage.googleapis.com/go1.18b7.src.tar.gz 6028ffee59903934a3182d45ee3e0c1c9f47fb98f05d9bbb2fabb4771db60792
-go1.18.1b7 d003f0850a7d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.1b7.linux-amd64.tar.gz a5b3985341de6ca54f6a8e13e9ae695f0ee202207e25f082c3895a8fc6f89f64
-go1.18.1b7 d003f0850a7d src https://go-boringcrypto.storage.googleapis.com/go1.18.1b7.src.tar.gz c7f91549b3a197e4a08f64e07546855ca8f82d597f60fd23c7ad2f082640a9fe
-go1.17.9b7 ed86dfc4e441 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.9b7.linux-amd64.tar.gz 9469d1b4c10f59c921c4666c52baba5f6ca63b1cce0eca95e03b5713ef27577c
-go1.17.9b7 ed86dfc4e441 src https://go-boringcrypto.storage.googleapis.com/go1.17.9b7.src.tar.gz 5d6bfe543a9a2bf6d8749973c771e40127b8020a769ecc5fb41d0dbd7deae9a6
diff --git a/misc/boring/VERSION b/misc/boring/VERSION
deleted file mode 100644
index 45a4fb7..0000000
--- a/misc/boring/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/misc/boring/build.docker b/misc/boring/build.docker
deleted file mode 100755
index 877d034..0000000
--- a/misc/boring/build.docker
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Copyright 2017 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# build.docker builds and publishes a Docker image for
-# a given Go+BoringCrypto release.
-
-set -e
-
-# With no arguments, use the most recent linux-amd64 release in the RELEASES file.
-case "$#" in
-0)
- version=$(grep linux-amd64 RELEASES | tail -1 | awk '{print $1}');;
-1)
- version="$1";;
-*)
- echo 'usage: build.docker [version]' >&2
- exit 2
-esac
-
-url="$(grep "^$version .* linux-amd64 " RELEASES | awk '{print $4}')"
-sha256="$(grep "^$version .* linux-amd64 " RELEASES | awk '{print $5}')"
-if [ "$sha256" = "" ]; then
- echo "cannot find $version in RELEASES file" >&2
- exit 2
-fi
-
-# Build a temporary directory with a Dockerfile.
-dir=$(mktemp -d)
-trap "rm -rf $dir" EXIT
-
-if echo "$url" | grep '!' >/dev/null; then
- # ! is sed delimiter below. Should never happen.
- echo "URL contains an exclamation mark!" >&2
- exit 2
-fi
-
-dversion=$(echo "$version" | sed 's/^go//')
-sed "s!UUU!$url!; s/SSS/$sha256/; s/VVV/$dversion/" dockerfile.in >$dir/Dockerfile
-
-dpkg=us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:$dversion
-
-docker build --pull -t $dpkg $dir
-docker run $dpkg go version
-docker run $dpkg go tool nm /usr/local/go/bin/go >$dir/nm
-if ! grep crypto/internal/boring/sig.BoringCrypto $dir/nm >/dev/null; then
- echo 'built docker image but did NOT find sig.BoringCrypto in go command!' >&2
- exit 2
-fi
-if egrep 'crypto/sha256\.\(\*digest\)' $dir/nm >/dev/null; then
- echo 'built docker image but DID find sha256.(*digest) in go command unexpectedly!' >&2
- exit 2
-fi
-docker push $dpkg
-
-echo
-echo published as $dpkg
diff --git a/misc/boring/build.release b/misc/boring/build.release
deleted file mode 100755
index ae08bab..0000000
--- a/misc/boring/build.release
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/bash
-# Copyright 2017 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# build.release builds and publishes a new Go+BoringCrypto release.
-# After running this script, the change to the RELEASES file should be
-# sent out for review and committed to the repository (but the release
-# is already done, so there's not much to review).
-
-set -e
-
-case "$#" in
-0)
- rev=HEAD;;
-1)
- rev="$1";;
-*)
- echo 'usage: build.release [git-rev]' >&2
- exit 2
-esac
-
-# Determine commit to use.
-commit=$(git rev-parse "$rev" | awk '{print substr($1, 1, 12)}')
-if [ "$commit" = "" ]; then
- echo 'cannot find commit in git history' >&2
- exit 2
-fi
-
-# Determine base Go release from tags.
-base=$(git log --decorate=short --oneline "$rev" | grep 'tag: go' | sed 1q | sed 's/[),].*//; s/.*tag: //')
-if [ "$base" = "" ]; then
- echo "cannot find go release tag in git history for $rev" >&2
- exit 2
-fi
-
-# Determine boring crypto version from file.
-boring=$(git show "$commit:misc/boring/VERSION")
-if [ "$boring" = "" ]; then
- echo "missing BORINGVERSION file in $commit" >&2
- exit 2
-fi
-
-# Make sure we're not redefining a published release.
-version="${base}b${boring}"
-if grep "^$version " RELEASES >/dev/null; then
- echo "found $version in RELEASES - not rereleasing" >&2
- exit 2
-fi
-
-# Show what's going on, while the release builds.
-# Good time for user to type ^C if something is wrong.
-echo >&2
-echo "building $version from $commit" >&2
-echo >&2
-git log -n1 "$commit" >&2
-echo >&2
-
-# Build the release tool in a temporary directory.
-dir=$(mktemp -d)
-trap "rm -rf $dir" EXIT
-GOBIN="$dir" go install golang.org/x/build/cmd/release@latest
-
-# Build the release.
-sha() {
- if hash sha256sum 2>/dev/null; then
- sha256sum "$@"
- else
- shasum -a 256 "$@"
- fi
-}
-shortgo=$(echo "$base" | perl -pe 's/(go\d+\.\d+)(\.\d+|rc\d+)/$1/')
-$dir/release -target linux-amd64 -rev "$commit" -version "$version" -skip_long_tests
-$dir/release -target src -rev "$commit" -version "$version"
-output="$version.linux-amd64.tar.gz"
-ls -l "$output"
-sha256=$(sha "$output" | awk '{print $1}')
-outputsrc="$version.src.tar.gz"
-ls -l "$outputsrc"
-sha256src=$(sha "$outputsrc" | awk '{print $1}')
-
-trap "rm -f /tmp/go.release.$$ /tmp/go.nm.$$" EXIT
-tar -xzf "$output" -O go/bin/go >/tmp/go.release.$$
-go tool nm /tmp/go.release.$$ >/tmp/go.nm.$$
-if ! grep crypto/internal/boring/sig.BoringCrypto /tmp/go.nm.$$ >/dev/null; then
- echo 'built release but did NOT find sig.BoringCrypto in go command!' >&2
- exit 2
-fi
-if egrep 'crypto/sha256\.\(\*digest\)' /tmp/go.nm.$$ >/dev/null; then
- echo 'built release but DID find sha256.(*digest) in go command unexpectedly!' >&2
- exit 2
-fi
-
-# Publish the release.
-gsutil cp "$output" gs://go-boringcrypto/
-url="https://go-boringcrypto.storage.googleapis.com/$output"
-gsutil cp "$outputsrc" gs://go-boringcrypto/
-urlsrc="https://go-boringcrypto.storage.googleapis.com/$outputsrc"
-
-# Record that it was published.
-echo "$version $commit linux-amd64 $url $sha256" >>RELEASES
-echo "$version $commit src $urlsrc $sha256src" >>RELEASES
diff --git a/misc/boring/dockerfile.in b/misc/boring/dockerfile.in
deleted file mode 100644
index b439089..0000000
--- a/misc/boring/dockerfile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-# Template for Dockerfile, used in build.docker script.
-# Based on https://github.com/docker-library/golang/blob/7e3d99a803/1.13/buster/Dockerfile
-FROM buildpack-deps:buster-scm
-
-# gcc for cgo
-RUN apt-get update && apt-get install -y --no-install-recommends \
- g++ \
- gcc \
- libc6-dev \
- make \
- pkg-config \
- && rm -rf /var/lib/apt/lists/*
-
-ENV GOLANG_VERSION VVV
-
-RUN set -eux; \
- \
- url="UUU"; \
- wget -O go.tgz "$url"; \
- echo "SSS go.tgz" | sha256sum -c -; \
- tar -C /usr/local -xzf go.tgz; \
- rm go.tgz; \
- \
- export PATH="/usr/local/go/bin:$PATH"; \
- go version
-
-ENV GOPATH /go
-ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
-
-RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
-WORKDIR $GOPATH
diff --git a/misc/boring/merge.sh b/misc/boring/merge.sh
deleted file mode 100755
index b158a90f..0000000
--- a/misc/boring/merge.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/bash
-set -euo pipefail
-
-if [ "$#" -ne 2 ]; then
- echo "usage: merge.sh <target branch> <source revision>"
- echo ""
- echo "example: merge.sh dev.boringcrypto master"
- echo " merge.sh dev.boringcrypto.go1.10 go1.10.7"
- exit 1
-fi
-
-TARGET="$1"
-SOURCE="$2"
-WORKTREE="$(mktemp -d)"
-BRANCH="boring/merge-$TARGET-$(date +%Y%m%d%H%M%S)"
-
-git fetch
-git worktree add --track -b "$BRANCH" "$WORKTREE" "origin/$TARGET"
-
-cd "$WORKTREE"
-export GIT_GOFMT_HOOK=off
-git merge --no-commit --no-stat "$SOURCE" || echo "Ignoring conflict..."
-[[ -f VERSION ]] && git rm -f VERSION
-git checkout --ours codereview.cfg && git add codereview.cfg
-git commit -m "all: merge $SOURCE into $TARGET"
-
-if ! git log --format=%B -n 1 | grep "\[$TARGET\] "; then
- echo "The commit does not seem to be targeting the BoringCrypto branch."
- echo "(Or you are missing the git-codereview hooks.)"
- exit 1
-fi
-
-git codereview mail -trybot HEAD
-cd - && git worktree remove "$WORKTREE"
diff --git a/misc/boring/release.sh b/misc/boring/release.sh
deleted file mode 100755
index 6e72a56..0000000
--- a/misc/boring/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/bash
-set -euo pipefail
-
-if [ "$#" -eq 0 ]; then
- echo "usage: <target branch> [<target branch> ...]"
- echo ""
- echo "example: release.sh dev.boringcrypto.go1.11 dev.boringcrypto.go1.12"
- exit 1
-fi
-
-# Check that the Docker daemon is available.
-docker ps > /dev/null
-
-WORKTREE="$(mktemp -d)"
-BRANCH="boring/release-$(date +%Y%m%d%H%M%S)"
-
-git fetch
-git worktree add --track -b "$BRANCH" "$WORKTREE" origin/dev.boringcrypto
-
-cd "$WORKTREE/src"
-GOEXPERIMENT=boringcrypto ./make.bash
-
-cd ../misc/boring
-for branch in "$@"; do
- ./build.release "origin/$branch"
- ./build.docker
-done
-
-git add RELEASES
-git commit -m "misc/boring: add new releases to RELEASES file"
-git codereview mail
-
-rm *.tar.gz
-cd - && git worktree remove "$WORKTREE"
diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go
index bcc273c..1da8ffa 100644
--- a/src/bufio/bufio.go
+++ b/src/bufio/bufio.go
@@ -203,7 +203,8 @@
// The bytes are taken from at most one Read on the underlying Reader,
// hence n may be less than len(p).
// To read exactly len(p) bytes, use io.ReadFull(b, p).
-// At EOF, the count will be zero and err will be io.EOF.
+// If the underlying Reader can return a non-zero count with io.EOF,
+// then this Read method can do so as well; see the [io.Reader] docs.
func (b *Reader) Read(p []byte) (n int, err error) {
n = len(p)
if n == 0 {
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go
index b2a023a..e6bf62d 100644
--- a/src/cmd/api/goapi.go
+++ b/src/cmd/api/goapi.go
@@ -16,10 +16,10 @@
"go/parser"
"go/token"
"go/types"
- exec "internal/execabs"
"io"
"log"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"runtime"
diff --git a/src/cmd/api/run.go b/src/cmd/api/run.go
index 3ceaae6..1ae629a 100644
--- a/src/cmd/api/run.go
+++ b/src/cmd/api/run.go
@@ -11,11 +11,11 @@
import (
"errors"
"fmt"
- exec "internal/execabs"
"internal/goversion"
"io/fs"
"log"
"os"
+ "os/exec"
"path/filepath"
"runtime"
"strconv"
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index a52163f..a469afa 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -1622,6 +1622,8 @@
} else if gomips == "softfloat" {
return []string{"-mabi=32", "-msoft-float"}
}
+ case "loong64":
+ return []string{"-mabi=lp64d"}
}
return nil
}
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index 75d48c2..e343459 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -175,6 +175,7 @@
"amd64": 8,
"arm": 4,
"arm64": 8,
+ "loong64": 8,
"m68k": 4,
"mips": 4,
"mipsle": 4,
@@ -200,6 +201,7 @@
"amd64": 8,
"arm": 4,
"arm64": 8,
+ "loong64": 8,
"m68k": 4,
"mips": 4,
"mipsle": 4,
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index adbb761..a27007e 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -14,10 +14,10 @@
"go/ast"
"go/printer"
"go/token"
- exec "internal/execabs"
"internal/xcoff"
"io"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"sort"
diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go
index 00d931b..779f7be 100644
--- a/src/cmd/cgo/util.go
+++ b/src/cmd/cgo/util.go
@@ -8,9 +8,9 @@
"bytes"
"fmt"
"go/token"
- exec "internal/execabs"
"io/ioutil"
"os"
+ "os/exec"
)
// run runs the command argv, feeding in stdin on standard input.
diff --git a/src/cmd/compile/internal/importer/ureader.go b/src/cmd/compile/internal/importer/ureader.go
index a22cd2b..b8938cd 100644
--- a/src/cmd/compile/internal/importer/ureader.go
+++ b/src/cmd/compile/internal/importer/ureader.go
@@ -148,11 +148,13 @@
func (r *reader) doPkg() *types2.Package {
path := r.String()
- if path == "builtin" {
- return nil // universe
- }
- if path == "" {
+ switch path {
+ case "":
path = r.p.PkgPath()
+ case "builtin":
+ return nil // universe
+ case "unsafe":
+ return types2.Unsafe
}
if pkg := r.p.imports[path]; pkg != nil {
@@ -371,7 +373,7 @@
tag := pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj))
if tag == pkgbits.ObjStub {
- assert(objPkg == nil || objPkg == types2.Unsafe)
+ base.Assertf(objPkg == nil || objPkg == types2.Unsafe, "unexpected stub package: %v", objPkg)
return objPkg, objName
}
diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go
index 486a6ad..1fbda92 100644
--- a/src/cmd/compile/internal/inline/inl.go
+++ b/src/cmd/compile/internal/inline/inl.go
@@ -934,10 +934,6 @@
lab := ir.NewLabelStmt(base.Pos, retlabel)
body = append(body, lab)
- if !typecheck.Go117ExportTypes {
- typecheck.Stmts(body)
- }
-
if base.Flag.GenDwarfInl > 0 {
for _, v := range inlfvars {
v.SetPos(subst.updatedPos(v.Pos()))
diff --git a/src/cmd/compile/internal/noder/irgen.go b/src/cmd/compile/internal/noder/irgen.go
index 5499ccd..628c0f5 100644
--- a/src/cmd/compile/internal/noder/irgen.go
+++ b/src/cmd/compile/internal/noder/irgen.go
@@ -36,7 +36,7 @@
ctxt := types2.NewContext()
importer := gcimports{
ctxt: ctxt,
- packages: map[string]*types2.Package{"unsafe": types2.Unsafe},
+ packages: make(map[string]*types2.Package),
}
conf := types2.Config{
Context: ctxt,
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go
index 1350c22..83ebe24 100644
--- a/src/cmd/compile/internal/noder/reader.go
+++ b/src/cmd/compile/internal/noder/reader.go
@@ -282,11 +282,13 @@
func (r *reader) doPkg() *types.Pkg {
path := r.String()
- if path == "builtin" {
- return types.BuiltinPkg
- }
- if path == "" {
+ switch path {
+ case "":
path = r.p.PkgPath()
+ case "builtin":
+ return types.BuiltinPkg
+ case "unsafe":
+ return types.UnsafePkg
}
name := r.String()
diff --git a/src/cmd/compile/internal/noder/stencil.go b/src/cmd/compile/internal/noder/stencil.go
index 41435a7..51ef6b1 100644
--- a/src/cmd/compile/internal/noder/stencil.go
+++ b/src/cmd/compile/internal/noder/stencil.go
@@ -416,7 +416,7 @@
var dictVar *ir.Name
var dictAssign *ir.AssignStmt
if outer != nil {
- dictVar = ir.NewNameAt(pos, typecheck.LookupNum(typecheck.LocalDictName, g.dnum))
+ dictVar = ir.NewNameAt(pos, closureSym(outer, typecheck.LocalDictName, g.dnum))
g.dnum++
dictVar.Class = ir.PAUTO
typed(types.Types[types.TUINTPTR], dictVar)
@@ -430,7 +430,7 @@
var rcvrVar *ir.Name
var rcvrAssign ir.Node
if rcvrValue != nil {
- rcvrVar = ir.NewNameAt(pos, typecheck.LookupNum(".rcvr", g.dnum))
+ rcvrVar = ir.NewNameAt(pos, closureSym(outer, ".rcvr", g.dnum))
g.dnum++
typed(rcvrValue.Type(), rcvrVar)
rcvrAssign = ir.NewAssignStmt(pos, rcvrVar, rcvrValue)
@@ -2221,7 +2221,7 @@
var formalResults []*types.Field // returns of closure
for i := 0; i < typ.NumParams(); i++ {
t := typ.Params().Field(i).Type
- arg := ir.NewNameAt(pos, typecheck.LookupNum("a", i))
+ arg := ir.NewNameAt(pos, closureSym(outer, "a", i))
arg.Class = ir.PPARAM
typed(t, arg)
arg.Curfn = fn
@@ -2233,7 +2233,7 @@
}
for i := 0; i < typ.NumResults(); i++ {
t := typ.Results().Field(i).Type
- result := ir.NewNameAt(pos, typecheck.LookupNum("r", i)) // TODO: names not needed?
+ result := ir.NewNameAt(pos, closureSym(outer, "r", i)) // TODO: names not needed?
result.Class = ir.PPARAMOUT
typed(t, result)
result.Curfn = fn
@@ -2252,6 +2252,16 @@
}
+// closureSym returns outer.Sym().Pkg.LookupNum(prefix, n).
+// If outer is nil, then types.LocalPkg is used instead.
+func closureSym(outer *ir.Func, prefix string, n int) *types.Sym {
+ pkg := types.LocalPkg
+ if outer != nil {
+ pkg = outer.Sym().Pkg
+ }
+ return pkg.LookupNum(prefix, n)
+}
+
// assertToBound returns a new node that converts a node rcvr with interface type to
// the 'dst' interface type.
func assertToBound(info *instInfo, dictVar *ir.Name, pos src.XPos, rcvr ir.Node, dst *types.Type) ir.Node {
diff --git a/src/cmd/compile/internal/noder/writer.go b/src/cmd/compile/internal/noder/writer.go
index 0fb162d..39f0ad7 100644
--- a/src/cmd/compile/internal/noder/writer.go
+++ b/src/cmd/compile/internal/noder/writer.go
@@ -214,13 +214,21 @@
w := pw.newWriter(pkgbits.RelocPkg, pkgbits.SyncPkgDef)
pw.pkgsIdx[pkg] = w.Idx
- if pkg == nil {
- w.String("builtin")
- } else {
+ // The universe and package unsafe need to be handled specially by
+ // importers anyway, so we serialize them using just their package
+ // path. This ensures that readers don't confuse them for
+ // user-defined packages.
+ switch pkg {
+ case nil: // universe
+ w.String("builtin") // same package path used by godoc
+ case types2.Unsafe:
+ w.String("unsafe")
+ default:
var path string
if pkg != w.p.curpkg {
path = pkg.Path()
}
+ base.Assertf(path != "builtin" && path != "unsafe", "unexpected path for user-defined package: %q", path)
w.String(path)
w.String(pkg.Name())
w.Len(pkg.Height())
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go
index d9a78b3..1e6060a 100644
--- a/src/cmd/compile/internal/ssa/html.go
+++ b/src/cmd/compile/internal/ssa/html.go
@@ -9,9 +9,9 @@
"cmd/internal/src"
"fmt"
"html"
- exec "internal/execabs"
"io"
"os"
+ "os/exec"
"path/filepath"
"strconv"
"strings"
diff --git a/src/cmd/compile/internal/ssa/loopreschedchecks.go b/src/cmd/compile/internal/ssa/loopreschedchecks.go
index 738c626..1326fa5 100644
--- a/src/cmd/compile/internal/ssa/loopreschedchecks.go
+++ b/src/cmd/compile/internal/ssa/loopreschedchecks.go
@@ -246,8 +246,8 @@
// mem1 := call resched (mem0)
// goto header
resched := f.fe.Syslook("goschedguarded")
- // TODO(register args) -- will need more details
- mem1 := sched.NewValue1A(bb.Pos, OpStaticCall, types.TypeMem, StaticAuxCall(resched, nil), mem0)
+ call := sched.NewValue1A(bb.Pos, OpStaticCall, types.TypeResultMem, StaticAuxCall(resched, bb.Func.ABIDefault.ABIAnalyzeTypes(nil, nil, nil)), mem0)
+ mem1 := sched.NewValue1I(bb.Pos, OpSelectN, types.TypeMem, 0, call)
sched.AddEdgeTo(h)
headerMemPhi.AddArg(mem1)
@@ -448,6 +448,16 @@
if last == nil {
b.Fatalf("no last store found - cycle?")
}
+
+ // If this is a tuple containing a mem, select just
+ // the mem. This will generate ops we don't need, but
+ // it's the easiest thing to do.
+ if last.Type.IsTuple() {
+ last = b.NewValue1(last.Pos, OpSelect1, types.TypeMem, last)
+ } else if last.Type.IsResults() {
+ last = b.NewValue1I(last.Pos, OpSelectN, types.TypeMem, int64(last.Type.NumFields()-1), last)
+ }
+
lastMems[b.ID] = last
}
return lastMems
diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go
index adb9544..f6176c4 100644
--- a/src/cmd/compile/internal/ssagen/ssa.go
+++ b/src/cmd/compile/internal/ssagen/ssa.go
@@ -4675,8 +4675,8 @@
return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1])
},
sys.AMD64, sys.ARM64, sys.PPC64, sys.S390X, sys.MIPS64, sys.RISCV64)
- alias("math/bits", "Mul", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64, sys.ArchPPC64LE, sys.ArchS390X, sys.ArchMIPS64, sys.ArchMIPS64LE, sys.ArchRISCV64)
- alias("runtime/internal/math", "Mul64", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64, sys.ArchPPC64LE, sys.ArchS390X, sys.ArchMIPS64, sys.ArchMIPS64LE, sys.ArchRISCV64)
+ alias("math/bits", "Mul", "math/bits", "Mul64", p8...)
+ alias("runtime/internal/math", "Mul64", "math/bits", "Mul64", p8...)
addF("math/bits", "Add64",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
return s.newValue3(ssa.OpAdd64carry, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1], args[2])
@@ -4749,11 +4749,7 @@
alias("sync/atomic", "AddUintptr", "runtime/internal/atomic", "Xadd64", p8...)
/******** math/big ********/
- add("math/big", "mulWW",
- func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
- return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1])
- },
- sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64LE, sys.ArchPPC64, sys.ArchS390X)
+ alias("math/big", "mulWW", "math/bits", "Mul64", p8...)
}
// findIntrinsic returns a function which builds the SSA equivalent of the
diff --git a/src/cmd/compile/internal/typecheck/func.go b/src/cmd/compile/internal/typecheck/func.go
index 6bfa7e6..f407ab6 100644
--- a/src/cmd/compile/internal/typecheck/func.go
+++ b/src/cmd/compile/internal/typecheck/func.go
@@ -137,11 +137,6 @@
return t
}
-// True if we are typechecking an inline body in ImportedBody below. We use this
-// flag to not create a new closure function in tcClosure when we are just
-// typechecking an inline body, as opposed to the body of a real function.
-var inTypeCheckInl bool
-
// ImportedBody returns immediately if the inlining information for fn is
// populated. Otherwise, fn must be an imported function. If so, ImportedBody
// loads in the dcls and body for fn, and typechecks as needed.
@@ -187,19 +182,6 @@
fmt.Printf("typecheck import [%v] %L { %v }\n", fn.Sym(), fn, ir.Nodes(fn.Inl.Body))
}
- if !go117ExportTypes {
- // If we didn't export & import types, typecheck the code here.
- savefn := ir.CurFunc
- ir.CurFunc = fn
- if inTypeCheckInl {
- base.Fatalf("inTypeCheckInl should not be set recursively")
- }
- inTypeCheckInl = true
- Stmts(fn.Inl.Body)
- inTypeCheckInl = false
- ir.CurFunc = savefn
- }
-
base.Pos = lno
}
@@ -276,15 +258,7 @@
clo.SetType(fn.Type())
- target := Target
- if inTypeCheckInl {
- // We're typechecking an imported function, so it's not actually
- // part of Target. Skip adding it to Target.Decls so we don't
- // compile it again.
- target = nil
- }
-
- return ir.UseClosure(clo, target)
+ return ir.UseClosure(clo, Target)
}
// type check function definition
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go
index 9436aa5..bf721d6 100644
--- a/src/cmd/compile/internal/typecheck/iexport.go
+++ b/src/cmd/compile/internal/typecheck/iexport.go
@@ -1590,11 +1590,7 @@
case ir.OAS2, ir.OAS2DOTTYPE, ir.OAS2FUNC, ir.OAS2MAPR, ir.OAS2RECV:
n := n.(*ir.AssignListStmt)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OAS2)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.stmtList(n.Init())
w.exprList(n.Lhs)
@@ -1759,9 +1755,7 @@
// Indicate that this is not an OKEY entry.
w.bool(false)
w.qualifiedIdent(n)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
break
}
@@ -1790,9 +1784,7 @@
s := n.Sym()
w.string(s.Name)
w.pkg(s.Pkg)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
// case OPACK:
// should have been resolved by typechecking - handled by default case
@@ -1864,16 +1856,10 @@
case ir.OPTRLIT:
n := n.(*ir.AddrExpr)
- if go117ExportTypes {
- w.op(ir.OPTRLIT)
- } else {
- w.op(ir.OADDR)
- }
+ w.op(ir.OPTRLIT)
w.pos(n.Pos())
w.expr(n.X)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OSTRUCTLIT:
n := n.(*ir.CompLitExpr)
@@ -1884,15 +1870,11 @@
case ir.OCOMPLIT, ir.OARRAYLIT, ir.OSLICELIT, ir.OMAPLIT:
n := n.(*ir.CompLitExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OCOMPLIT)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.typ(n.Type())
w.exprList(n.List)
- if go117ExportTypes && n.Op() == ir.OSLICELIT {
+ if n.Op() == ir.OSLICELIT {
w.uint64(uint64(n.Len))
}
case ir.OKEY:
@@ -1907,37 +1889,25 @@
case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OMETHVALUE, ir.OMETHEXPR:
n := n.(*ir.SelectorExpr)
- if go117ExportTypes {
- // For go117ExportTypes, we usually see all ops except
- // OXDOT, but we can see OXDOT for generic functions.
- w.op(n.Op())
- } else {
- w.op(ir.OXDOT)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
w.exoticSelector(n.Sel)
- if go117ExportTypes {
- w.exoticType(n.Type())
- if n.Op() == ir.OXDOT {
- // n.Selection for method references will be
- // reconstructed during import.
- w.bool(n.Selection != nil)
- } else if n.Op() == ir.ODOT || n.Op() == ir.ODOTPTR || n.Op() == ir.ODOTINTER {
- w.exoticField(n.Selection)
- }
- // n.Selection is not required for OMETHEXPR, ODOTMETH, and OMETHVALUE. It will
- // be reconstructed during import. n.Selection is computed during
- // transformDot() for OXDOT.
+ w.exoticType(n.Type())
+ if n.Op() == ir.OXDOT {
+ // n.Selection for method references will be
+ // reconstructed during import.
+ w.bool(n.Selection != nil)
+ } else if n.Op() == ir.ODOT || n.Op() == ir.ODOTPTR || n.Op() == ir.ODOTINTER {
+ w.exoticField(n.Selection)
}
+ // n.Selection is not required for OMETHEXPR, ODOTMETH, and OMETHVALUE. It will
+ // be reconstructed during import. n.Selection is computed during
+ // transformDot() for OXDOT.
case ir.ODOTTYPE, ir.ODOTTYPE2:
n := n.(*ir.TypeAssertExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.ODOTTYPE)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
w.typ(n.Type())
@@ -1952,70 +1922,45 @@
case ir.OINDEX, ir.OINDEXMAP:
n := n.(*ir.IndexExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OINDEX)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
w.expr(n.Index)
- if go117ExportTypes {
- w.exoticType(n.Type())
- if n.Op() == ir.OINDEXMAP {
- w.bool(n.Assigned)
- }
+ w.exoticType(n.Type())
+ if n.Op() == ir.OINDEXMAP {
+ w.bool(n.Assigned)
}
case ir.OSLICE, ir.OSLICESTR, ir.OSLICEARR:
n := n.(*ir.SliceExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OSLICE)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
w.exprsOrNil(n.Low, n.High)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OSLICE3, ir.OSLICE3ARR:
n := n.(*ir.SliceExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OSLICE3)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
w.exprsOrNil(n.Low, n.High)
w.expr(n.Max)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OCOPY, ir.OCOMPLEX, ir.OUNSAFEADD, ir.OUNSAFESLICE:
// treated like other builtin calls (see e.g., OREAL)
n := n.(*ir.BinaryExpr)
w.op(n.Op())
w.pos(n.Pos())
+ w.stmtList(n.Init())
w.expr(n.X)
w.expr(n.Y)
- if go117ExportTypes {
- w.typ(n.Type())
- } else {
- w.op(ir.OEND)
- }
+ w.typ(n.Type())
case ir.OCONV, ir.OCONVIFACE, ir.OCONVIDATA, ir.OCONVNOP, ir.OBYTES2STR, ir.ORUNES2STR, ir.OSTR2BYTES, ir.OSTR2RUNES, ir.ORUNESTR, ir.OSLICE2ARRPTR:
n := n.(*ir.ConvExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OCONV)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.typ(n.Type())
w.expr(n.X)
@@ -2025,18 +1970,15 @@
w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
- if go117ExportTypes {
- if n.Op() != ir.OPANIC {
- w.typ(n.Type())
- }
- } else {
- w.op(ir.OEND)
+ if n.Op() != ir.OPANIC {
+ w.typ(n.Type())
}
case ir.OAPPEND, ir.ODELETE, ir.ORECOVER, ir.OPRINT, ir.OPRINTN:
n := n.(*ir.CallExpr)
w.op(n.Op())
w.pos(n.Pos())
+ w.stmtList(n.Init())
w.exprList(n.Args) // emits terminating OEND
// only append() calls may contain '...' arguments
if n.Op() == ir.OAPPEND {
@@ -2044,27 +1986,19 @@
} else if n.IsDDD {
base.Fatalf("exporter: unexpected '...' with %v call", n.Op())
}
- if go117ExportTypes {
- if n.Op() != ir.ODELETE && n.Op() != ir.OPRINT && n.Op() != ir.OPRINTN {
- w.typ(n.Type())
- }
+ if n.Op() != ir.ODELETE && n.Op() != ir.OPRINT && n.Op() != ir.OPRINTN {
+ w.typ(n.Type())
}
case ir.OCALL, ir.OCALLFUNC, ir.OCALLMETH, ir.OCALLINTER, ir.OGETG:
n := n.(*ir.CallExpr)
- if go117ExportTypes {
- w.op(n.Op())
- } else {
- w.op(ir.OCALL)
- }
+ w.op(n.Op())
w.pos(n.Pos())
w.stmtList(n.Init())
w.expr(n.X)
w.exprList(n.Args)
w.bool(n.IsDDD)
- if go117ExportTypes {
- w.exoticType(n.Type())
- }
+ w.exoticType(n.Type())
case ir.OMAKEMAP, ir.OMAKECHAN, ir.OMAKESLICE:
n := n.(*ir.MakeExpr)
@@ -2085,7 +2019,7 @@
// an argument. Don't serialize that argument here.
w.expr(n.Len)
w.op(ir.OEND)
- case n.Len != nil && go117ExportTypes:
+ case n.Len != nil:
w.expr(n.Len)
w.op(ir.OEND)
}
@@ -2104,27 +2038,21 @@
w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OADDR:
n := n.(*ir.AddrExpr)
w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.ODEREF:
n := n.(*ir.StarExpr)
w.op(n.Op())
w.pos(n.Pos())
w.expr(n.X)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OSEND:
n := n.(*ir.SendStmt)
@@ -2141,9 +2069,7 @@
w.pos(n.Pos())
w.expr(n.X)
w.expr(n.Y)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OANDAND, ir.OOROR:
n := n.(*ir.LogicalExpr)
@@ -2151,18 +2077,14 @@
w.pos(n.Pos())
w.expr(n.X)
w.expr(n.Y)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OADDSTR:
n := n.(*ir.AddStringExpr)
w.op(ir.OADDSTR)
w.pos(n.Pos())
w.exprList(n.List)
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.ODCLCONST:
// if exporting, DCLCONST should just be removed as its usage
@@ -2177,9 +2099,7 @@
for _, targ := range n.Targs {
w.typ(targ.Type())
}
- if go117ExportTypes {
- w.typ(n.Type())
- }
+ w.typ(n.Type())
case ir.OSELRECV2:
n := n.(*ir.AssignListStmt)
@@ -2295,15 +2215,5 @@
w.Write(buf[:n])
}
-// If go117ExportTypes is true, then we write type information when
-// exporting function bodies, so those function bodies don't need to
-// be re-typechecked on import.
-// This flag adds some other info to the serialized stream as well
-// which was previously recomputed during typechecking, like
-// specializing opcodes (e.g. OXDOT to ODOTPTR) and ancillary
-// information (e.g. length field for OSLICELIT).
-const go117ExportTypes = true
-const Go117ExportTypes = go117ExportTypes
-
// The name used for dictionary parameters or local variables.
const LocalDictName = ".dict"
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index 654aff8..7ce613c 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -1137,11 +1137,9 @@
// functions).
body = []ir.Node{}
}
- if go117ExportTypes {
- ir.VisitList(body, func(n ir.Node) {
- n.SetTypecheck(1)
- })
- }
+ ir.VisitList(body, func(n ir.Node) {
+ n.SetTypecheck(1)
+ })
fn.Inl.Body = body
r.curfn = outerfn
@@ -1319,19 +1317,15 @@
case ir.ONONAME:
isKey := r.bool()
- n := r.qualifiedIdent()
- if go117ExportTypes {
- var n2 ir.Node = n
- // Key ONONAME entries should not be resolved - they should
- // stay as identifiers.
- if !isKey {
- n2 = Resolve(n)
- }
- typ := r.typ()
- if n2.Type() == nil {
- n2.SetType(typ)
- }
- return n2
+ var n ir.Node = r.qualifiedIdent()
+ // Key ONONAME entries should not be resolved - they should
+ // stay as identifiers.
+ if !isKey {
+ n = Resolve(n)
+ }
+ typ := r.typ()
+ if n.Type() == nil {
+ n.SetType(typ)
}
return n
@@ -1386,7 +1380,7 @@
cvars := make([]*ir.Name, r.int64())
for i := range cvars {
cvars[i] = ir.CaptureName(r.pos(), fn, r.localName().Canonical())
- if go117ExportTypes && cvars[i].Defn == nil {
+ if cvars[i].Defn == nil {
base.Fatalf("bad import of closure variable")
}
}
@@ -1409,21 +1403,16 @@
ir.FinishCaptureNames(pos, r.curfn, fn)
clo := fn.OClosure
- if go117ExportTypes {
- clo.SetType(typ)
- }
+ clo.SetType(typ)
return clo
case ir.OSTRUCTLIT:
- if go117ExportTypes {
- pos := r.pos()
- typ := r.typ()
- list := r.fieldList()
- n := ir.NewCompLitExpr(pos, ir.OSTRUCTLIT, nil, list)
- n.SetType(typ)
- return n
- }
- return ir.NewCompLitExpr(r.pos(), ir.OCOMPLIT, ir.TypeNode(r.typ()), r.fieldList())
+ pos := r.pos()
+ typ := r.typ()
+ list := r.fieldList()
+ n := ir.NewCompLitExpr(pos, ir.OSTRUCTLIT, nil, list)
+ n.SetType(typ)
+ return n
case ir.OCOMPLIT:
pos := r.pos()
@@ -1433,10 +1422,6 @@
return n
case ir.OARRAYLIT, ir.OSLICELIT, ir.OMAPLIT:
- if !go117ExportTypes {
- // unreachable - mapped to OCOMPLIT by exporter
- goto error
- }
pos := r.pos()
typ := r.typ()
list := r.exprList()
@@ -1454,55 +1439,47 @@
// unreachable - handled in case OSTRUCTLIT by elemList
case ir.OXDOT, ir.ODOT, ir.ODOTPTR, ir.ODOTINTER, ir.ODOTMETH, ir.OMETHVALUE, ir.OMETHEXPR:
- // For !go117ExportTypes, we should only see OXDOT.
- // For go117ExportTypes, we usually see all the other ops, but can see
- // OXDOT for generic functions.
- if op != ir.OXDOT && !go117ExportTypes {
- goto error
- }
pos := r.pos()
expr := r.expr()
sel := r.exoticSelector()
n := ir.NewSelectorExpr(pos, op, expr, sel)
- if go117ExportTypes {
- n.SetType(r.exoticType())
- switch op {
- case ir.OXDOT:
- hasSelection := r.bool()
- // We reconstruct n.Selection for method calls on
- // generic types and method calls due to type param
- // bounds. Otherwise, n.Selection is nil.
- if hasSelection {
- n1 := ir.NewSelectorExpr(pos, op, expr, sel)
- AddImplicitDots(n1)
- var m *types.Field
- if n1.X.Type().IsTypeParam() {
- genType := n1.X.Type().Bound()
- m = Lookdot1(n1, sel, genType, genType.AllMethods(), 1)
- } else {
- genType := types.ReceiverBaseType(n1.X.Type())
- if genType.IsInstantiatedGeneric() {
- genType = genType.OrigType()
- }
- m = Lookdot1(n1, sel, genType, genType.Methods(), 1)
+ n.SetType(r.exoticType())
+ switch op {
+ case ir.OXDOT:
+ hasSelection := r.bool()
+ // We reconstruct n.Selection for method calls on
+ // generic types and method calls due to type param
+ // bounds. Otherwise, n.Selection is nil.
+ if hasSelection {
+ n1 := ir.NewSelectorExpr(pos, op, expr, sel)
+ AddImplicitDots(n1)
+ var m *types.Field
+ if n1.X.Type().IsTypeParam() {
+ genType := n1.X.Type().Bound()
+ m = Lookdot1(n1, sel, genType, genType.AllMethods(), 1)
+ } else {
+ genType := types.ReceiverBaseType(n1.X.Type())
+ if genType.IsInstantiatedGeneric() {
+ genType = genType.OrigType()
}
- assert(m != nil)
- n.Selection = m
+ m = Lookdot1(n1, sel, genType, genType.Methods(), 1)
}
- case ir.ODOT, ir.ODOTPTR, ir.ODOTINTER:
- n.Selection = r.exoticField()
- case ir.OMETHEXPR:
- n = typecheckMethodExpr(n).(*ir.SelectorExpr)
- case ir.ODOTMETH, ir.OMETHVALUE:
- // These require a Lookup to link to the correct declaration.
- rcvrType := expr.Type()
- typ := n.Type()
- n.Selection = Lookdot(n, rcvrType, 1)
- if op == ir.OMETHVALUE {
- // Lookdot clobbers the opcode and type, undo that.
- n.SetOp(op)
- n.SetType(typ)
- }
+ assert(m != nil)
+ n.Selection = m
+ }
+ case ir.ODOT, ir.ODOTPTR, ir.ODOTINTER:
+ n.Selection = r.exoticField()
+ case ir.OMETHEXPR:
+ n = typecheckMethodExpr(n).(*ir.SelectorExpr)
+ case ir.ODOTMETH, ir.OMETHVALUE:
+ // These require a Lookup to link to the correct declaration.
+ rcvrType := expr.Type()
+ typ := n.Type()
+ n.Selection = Lookdot(n, rcvrType, 1)
+ if op == ir.OMETHVALUE {
+ // Lookdot clobbers the opcode and type, undo that.
+ n.SetOp(op)
+ n.SetType(typ)
}
}
return n
@@ -1510,9 +1487,7 @@
case ir.ODOTTYPE, ir.ODOTTYPE2:
n := ir.NewTypeAssertExpr(r.pos(), r.expr(), nil)
n.SetType(r.typ())
- if go117ExportTypes {
- n.SetOp(op)
- }
+ n.SetOp(op)
return n
case ir.ODYNAMICDOTTYPE, ir.ODYNAMICDOTTYPE2:
@@ -1522,12 +1497,10 @@
case ir.OINDEX, ir.OINDEXMAP:
n := ir.NewIndexExpr(r.pos(), r.expr(), r.expr())
- if go117ExportTypes {
- n.SetOp(op)
- n.SetType(r.exoticType())
- if op == ir.OINDEXMAP {
- n.Assigned = r.bool()
- }
+ n.SetOp(op)
+ n.SetType(r.exoticType())
+ if op == ir.OINDEXMAP {
+ n.Assigned = r.bool()
}
return n
@@ -1539,84 +1512,65 @@
max = r.expr()
}
n := ir.NewSliceExpr(pos, op, x, low, high, max)
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
case ir.OCONV, ir.OCONVIFACE, ir.OCONVIDATA, ir.OCONVNOP, ir.OBYTES2STR, ir.ORUNES2STR, ir.OSTR2BYTES, ir.OSTR2RUNES, ir.ORUNESTR, ir.OSLICE2ARRPTR:
- if !go117ExportTypes && op != ir.OCONV {
- // unreachable - mapped to OCONV case by exporter
- goto error
- }
return ir.NewConvExpr(r.pos(), op, r.typ(), r.expr())
case ir.OCOPY, ir.OCOMPLEX, ir.OREAL, ir.OIMAG, ir.OAPPEND, ir.OCAP, ir.OCLOSE, ir.ODELETE, ir.OLEN, ir.OMAKE, ir.ONEW, ir.OPANIC, ir.ORECOVER, ir.OPRINT, ir.OPRINTN, ir.OUNSAFEADD, ir.OUNSAFESLICE:
- if go117ExportTypes {
- switch op {
- case ir.OCOPY, ir.OCOMPLEX, ir.OUNSAFEADD, ir.OUNSAFESLICE:
- n := ir.NewBinaryExpr(r.pos(), op, r.expr(), r.expr())
+ pos := r.pos()
+ switch op {
+ case ir.OCOPY, ir.OCOMPLEX, ir.OUNSAFEADD, ir.OUNSAFESLICE:
+ init := r.stmtList()
+ n := ir.NewBinaryExpr(pos, op, r.expr(), r.expr())
+ n.SetInit(init)
+ n.SetType(r.typ())
+ return n
+ case ir.OREAL, ir.OIMAG, ir.OCAP, ir.OCLOSE, ir.OLEN, ir.ONEW, ir.OPANIC:
+ n := ir.NewUnaryExpr(pos, op, r.expr())
+ if op != ir.OPANIC {
n.SetType(r.typ())
- return n
- case ir.OREAL, ir.OIMAG, ir.OCAP, ir.OCLOSE, ir.OLEN, ir.ONEW, ir.OPANIC:
- n := ir.NewUnaryExpr(r.pos(), op, r.expr())
- if op != ir.OPANIC {
- n.SetType(r.typ())
- }
- return n
- case ir.OAPPEND, ir.ODELETE, ir.ORECOVER, ir.OPRINT, ir.OPRINTN:
- n := ir.NewCallExpr(r.pos(), op, nil, r.exprList())
- if op == ir.OAPPEND {
- n.IsDDD = r.bool()
- }
- if op == ir.OAPPEND || op == ir.ORECOVER {
- n.SetType(r.typ())
- }
- return n
}
- // ir.OMAKE
- goto error
+ return n
+ case ir.OAPPEND, ir.ODELETE, ir.ORECOVER, ir.OPRINT, ir.OPRINTN:
+ init := r.stmtList()
+ n := ir.NewCallExpr(pos, op, nil, r.exprList())
+ n.SetInit(init)
+ if op == ir.OAPPEND {
+ n.IsDDD = r.bool()
+ }
+ if op == ir.OAPPEND || op == ir.ORECOVER {
+ n.SetType(r.typ())
+ }
+ return n
}
- n := builtinCall(r.pos(), op)
- n.Args = r.exprList()
- if op == ir.OAPPEND {
- n.IsDDD = r.bool()
- }
- return n
+ // ir.OMAKE
+ goto error
case ir.OCALL, ir.OCALLFUNC, ir.OCALLMETH, ir.OCALLINTER, ir.OGETG:
pos := r.pos()
init := r.stmtList()
n := ir.NewCallExpr(pos, ir.OCALL, r.expr(), r.exprList())
- if go117ExportTypes {
- n.SetOp(op)
- }
+ n.SetOp(op)
n.SetInit(init)
n.IsDDD = r.bool()
- if go117ExportTypes {
- n.SetType(r.exoticType())
- }
+ n.SetType(r.exoticType())
return n
case ir.OMAKEMAP, ir.OMAKECHAN, ir.OMAKESLICE:
- if go117ExportTypes {
- pos := r.pos()
- typ := r.typ()
- list := r.exprList()
- var len_, cap_ ir.Node
- if len(list) > 0 {
- len_ = list[0]
- }
- if len(list) > 1 {
- cap_ = list[1]
- }
- n := ir.NewMakeExpr(pos, op, len_, cap_)
- n.SetType(typ)
- return n
+ pos := r.pos()
+ typ := r.typ()
+ list := r.exprList()
+ var len_, cap_ ir.Node
+ if len(list) > 0 {
+ len_ = list[0]
}
- n := builtinCall(r.pos(), ir.OMAKE)
- n.Args.Append(ir.TypeNode(r.typ()))
- n.Args.Append(r.exprList()...)
+ if len(list) > 1 {
+ cap_ = list[1]
+ }
+ n := ir.NewMakeExpr(pos, op, len_, cap_)
+ n.SetType(typ)
return n
case ir.OLINKSYMOFFSET:
@@ -1629,45 +1583,33 @@
// unary expressions
case ir.OPLUS, ir.ONEG, ir.OBITNOT, ir.ONOT, ir.ORECV, ir.OIDATA:
n := ir.NewUnaryExpr(r.pos(), op, r.expr())
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
case ir.OADDR, ir.OPTRLIT:
- if go117ExportTypes {
- pos := r.pos()
- expr := r.expr()
- expr.SetTypecheck(1) // we do this for all nodes after importing, but do it now so markAddrOf can see it.
- n := NodAddrAt(pos, expr)
- n.SetOp(op)
- n.SetType(r.typ())
- return n
- }
- n := NodAddrAt(r.pos(), r.expr())
+ pos := r.pos()
+ expr := r.expr()
+ expr.SetTypecheck(1) // we do this for all nodes after importing, but do it now so markAddrOf can see it.
+ n := NodAddrAt(pos, expr)
+ n.SetOp(op)
+ n.SetType(r.typ())
return n
case ir.ODEREF:
n := ir.NewStarExpr(r.pos(), r.expr())
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
// binary expressions
case ir.OADD, ir.OAND, ir.OANDNOT, ir.ODIV, ir.OEQ, ir.OGE, ir.OGT, ir.OLE, ir.OLT,
ir.OLSH, ir.OMOD, ir.OMUL, ir.ONE, ir.OOR, ir.ORSH, ir.OSUB, ir.OXOR, ir.OEFACE:
n := ir.NewBinaryExpr(r.pos(), op, r.expr(), r.expr())
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
case ir.OANDAND, ir.OOROR:
n := ir.NewLogicalExpr(r.pos(), op, r.expr(), r.expr())
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
case ir.OSEND:
@@ -1676,16 +1618,9 @@
case ir.OADDSTR:
pos := r.pos()
list := r.exprList()
- if go117ExportTypes {
- n := ir.NewAddStringExpr(pos, list)
- n.SetType(r.typ())
- return n
- }
- x := list[0]
- for _, y := range list[1:] {
- x = ir.NewBinaryExpr(pos, ir.OADD, x, y)
- }
- return x
+ n := ir.NewAddStringExpr(pos, list)
+ n.SetType(r.typ())
+ return n
// --------------------------------------------------------------------
// statements
@@ -1718,10 +1653,6 @@
return n
case ir.OAS2, ir.OAS2DOTTYPE, ir.OAS2FUNC, ir.OAS2MAPR, ir.OAS2RECV:
- if !go117ExportTypes && op != ir.OAS2 {
- // unreachable - mapped to case OAS2 by exporter
- goto error
- }
pos := r.pos()
init := r.stmtList()
n := ir.NewAssignListStmt(pos, op, r.exprList(), r.exprList())
@@ -1808,9 +1739,7 @@
}
}
n := ir.NewInstExpr(pos, ir.OFUNCINST, x, targs)
- if go117ExportTypes {
- n.SetType(r.typ())
- }
+ n.SetType(r.typ())
return n
case ir.OSELRECV2:
@@ -1858,14 +1787,6 @@
return
}
-func builtinCall(pos src.XPos, op ir.Op) *ir.CallExpr {
- if go117ExportTypes {
- // These should all be encoded as direct ops, not OCALL.
- base.Fatalf("builtinCall should not be invoked when types are included in import/export")
- }
- return ir.NewCallExpr(pos, ir.OCALL, ir.NewIdent(base.Pos, types.BuiltinPkg.Lookup(ir.OpNames[op])), nil)
-}
-
// NewIncompleteNamedType returns a TFORW type t with name specified by sym, such
// that t.nod and sym.Def are set correctly. If there are any RParams for the type,
// they should be set soon after creating the TFORW type, before creating the
diff --git a/src/cmd/compile/internal/typecheck/subr.go b/src/cmd/compile/internal/typecheck/subr.go
index d4ec52a..af16e82 100644
--- a/src/cmd/compile/internal/typecheck/subr.go
+++ b/src/cmd/compile/internal/typecheck/subr.go
@@ -8,7 +8,6 @@
"bytes"
"fmt"
"sort"
- "strconv"
"strings"
"cmd/compile/internal/base"
@@ -22,13 +21,9 @@
return assignconvfn(n, t, func() string { return context })
}
-// LookupNum looks up the symbol starting with prefix and ending with
-// the decimal n. If prefix is too long, LookupNum panics.
+// LookupNum returns types.LocalPkg.LookupNum(prefix, n).
func LookupNum(prefix string, n int) *types.Sym {
- var buf [20]byte // plenty long enough for all current users
- copy(buf[:], prefix)
- b := strconv.AppendInt(buf[:len(prefix)], int64(n), 10)
- return types.LocalPkg.LookupBytes(b)
+ return types.LocalPkg.LookupNum(prefix, n)
}
// Given funarg struct list, return list of fn args.
diff --git a/src/cmd/compile/internal/types/pkg.go b/src/cmd/compile/internal/types/pkg.go
index b159eb5..4bf39a5 100644
--- a/src/cmd/compile/internal/types/pkg.go
+++ b/src/cmd/compile/internal/types/pkg.go
@@ -9,6 +9,7 @@
"cmd/internal/objabi"
"fmt"
"sort"
+ "strconv"
"sync"
)
@@ -121,6 +122,15 @@
return pkg.Lookup(str)
}
+// LookupNum looks up the symbol starting with prefix and ending with
+// the decimal n. If prefix is too long, LookupNum panics.
+func (pkg *Pkg) LookupNum(prefix string, n int) *Sym {
+ var buf [20]byte // plenty long enough for all current users
+ copy(buf[:], prefix)
+ b := strconv.AppendInt(buf[:len(prefix)], int64(n), 10)
+ return pkg.LookupBytes(b)
+}
+
var (
internedStringsmu sync.Mutex // protects internedStrings
internedStrings = map[string]string{}
diff --git a/src/cmd/cover/func.go b/src/cmd/cover/func.go
index 76a16b3..dffd3c1 100644
--- a/src/cmd/cover/func.go
+++ b/src/cmd/cover/func.go
@@ -15,9 +15,9 @@
"go/ast"
"go/parser"
"go/token"
- exec "internal/execabs"
"io"
"os"
+ "os/exec"
"path"
"path/filepath"
"runtime"
diff --git a/src/cmd/cover/testdata/toolexec.go b/src/cmd/cover/testdata/toolexec.go
index 458adae..1769efe 100644
--- a/src/cmd/cover/testdata/toolexec.go
+++ b/src/cmd/cover/testdata/toolexec.go
@@ -15,8 +15,8 @@
package main
import (
- exec "internal/execabs"
"os"
+ "os/exec"
"strings"
)
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 519f33a..f99f1f4 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -27,6 +27,7 @@
var (
goarch string
gorootBin string
+ gorootBinGo string
gohostarch string
gohostos string
goos string
@@ -64,6 +65,7 @@
"amd64",
"arm",
"arm64",
+ "loong64",
"mips",
"mipsle",
"mips64",
@@ -114,6 +116,12 @@
goroot = filepath.Clean(b)
gorootBin = pathf("%s/bin", goroot)
+ // Don't run just 'go' because the build infrastructure
+ // runs cmd/dist inside go/bin often, and on Windows
+ // it will be found in the current directory and refuse to exec.
+ // All exec calls rewrite "go" into gorootBinGo.
+ gorootBinGo = pathf("%s/bin/go", goroot)
+
b = os.Getenv("GOROOT_FINAL")
if b == "" {
b = goroot
@@ -199,13 +207,6 @@
goexperiment = os.Getenv("GOEXPERIMENT")
// TODO(mdempsky): Validate known experiments?
- if !strings.Contains(goexperiment, "boringcrypto") {
- if goexperiment != "" {
- goexperiment += ","
- }
- goexperiment += "boringcrypto"
- }
-
gogcflags = os.Getenv("BOOT_GO_GCFLAGS")
goldflags = os.Getenv("BOOT_GO_LDFLAGS")
@@ -1561,6 +1562,7 @@
"linux/amd64": true,
"linux/arm": true,
"linux/arm64": true,
+ "linux/loong64": true,
"linux/ppc64": false,
"linux/ppc64le": true,
"linux/mips": true,
@@ -1600,6 +1602,7 @@
// filtered out of cgoEnabled for 'dist list'. See golang.org/issue/28944
var incomplete = map[string]bool{
"linux/sparc64": true,
+ "linux/loong64": true,
}
// List of platforms which are first class ports. See golang.org/issue/38874.
diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
index 3161e3f..f1f3d50 100644
--- a/src/cmd/dist/buildtool.go
+++ b/src/cmd/dist/buildtool.go
@@ -88,6 +88,8 @@
var ignoreSuffixes = []string{
"_arm64.s",
"_arm64.go",
+ "_loong64.s",
+ "_loong64.go",
"_riscv64.s",
"_riscv64.go",
"_wasm.s",
@@ -309,8 +311,6 @@
if strings.HasPrefix(line, `import "`) || strings.HasPrefix(line, `import . "`) ||
inBlock && (strings.HasPrefix(line, "\t\"") || strings.HasPrefix(line, "\t. \"") || strings.HasPrefix(line, "\texec \"")) {
line = strings.Replace(line, `"cmd/`, `"bootstrap/cmd/`, -1)
- // During bootstrap, must use plain os/exec.
- line = strings.Replace(line, `exec "internal/execabs"`, `"os/exec"`, -1)
for _, dir := range bootstrapDirs {
if strings.HasPrefix(dir, "cmd/") {
continue
diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go
index 212d5cb..2651ecb 100644
--- a/src/cmd/dist/main.go
+++ b/src/cmd/dist/main.go
@@ -133,6 +133,8 @@
if elfIsLittleEndian(os.Args[0]) {
gohostarch = "mipsle"
}
+ case strings.Contains(out, "loongarch64"):
+ gohostarch = "loong64"
case strings.Contains(out, "riscv64"):
gohostarch = "riscv64"
case strings.Contains(out, "s390x"):
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 7c8f1ea..be4c552 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -27,6 +27,7 @@
gogcflags = os.Getenv("GO_GCFLAGS")
var t tester
+
var noRebuild bool
flag.BoolVar(&t.listMode, "list", false, "list available tests")
flag.BoolVar(&t.rebuild, "rebuild", false, "rebuild everything first")
@@ -96,15 +97,9 @@
func (t *tester) run() {
timelog("start", "dist test")
- var exeSuffix string
- if goos == "windows" {
- exeSuffix = ".exe"
- }
- if _, err := os.Stat(filepath.Join(gorootBin, "go"+exeSuffix)); err == nil {
- os.Setenv("PATH", fmt.Sprintf("%s%c%s", gorootBin, os.PathListSeparator, os.Getenv("PATH")))
- }
+ os.Setenv("PATH", fmt.Sprintf("%s%c%s", gorootBin, os.PathListSeparator, os.Getenv("PATH")))
- cmd := exec.Command("go", "env", "CGO_ENABLED")
+ cmd := exec.Command(gorootBinGo, "env", "CGO_ENABLED")
cmd.Stderr = new(bytes.Buffer)
slurp, err := cmd.Output()
if err != nil {
@@ -419,7 +414,7 @@
args = append(args, "-run=^$")
}
args = append(args, stdMatches...)
- cmd := exec.Command("go", args...)
+ cmd := exec.Command(gorootBinGo, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
@@ -456,7 +451,7 @@
args = append(args, "-bench=.*")
}
args = append(args, benchMatches...)
- cmd := exec.Command("go", args...)
+ cmd := exec.Command(gorootBinGo, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
@@ -484,7 +479,7 @@
} else {
// Use a format string to only list packages and commands that have tests.
const format = "{{if (or .TestGoFiles .XTestGoFiles)}}{{.ImportPath}}{{end}}"
- cmd := exec.Command("go", "list", "-f", format)
+ cmd := exec.Command(gorootBinGo, "list", "-f", format)
if t.race {
cmd.Args = append(cmd.Args, "-tags=race")
}
@@ -619,7 +614,7 @@
fmt.Println("skipping terminal test; stdout/stderr not terminals")
return nil
}
- cmd := exec.Command("go", "test")
+ cmd := exec.Command(gorootBinGo, "test")
setDir(cmd, filepath.Join(os.Getenv("GOROOT"), "src/cmd/go/testdata/testterminal18153"))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
@@ -1003,7 +998,11 @@
}
list = out
- return list[0], list[1:]
+ bin = list[0]
+ if bin == "go" {
+ bin = gorootBinGo
+ }
+ return bin, list[1:]
}
func (t *tester) addCmd(dt *distTest, dir string, cmdline ...interface{}) *exec.Cmd {
@@ -1035,7 +1034,7 @@
"darwin-amd64", "darwin-arm64",
"dragonfly-amd64",
"freebsd-386", "freebsd-amd64", "freebsd-arm",
- "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-riscv64", "linux-s390x",
+ "linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-loong64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-riscv64", "linux-s390x",
"netbsd-386", "netbsd-amd64",
"openbsd-386", "openbsd-amd64",
"windows-386", "windows-amd64":
@@ -1061,7 +1060,7 @@
// Internally linking cgo is incomplete on some architectures.
// https://golang.org/issue/10373
// https://golang.org/issue/14449
- if goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
+ if goarch == "loong64" || goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
return false
}
if goos == "aix" {
@@ -1157,7 +1156,7 @@
}
func (t *tester) runHostTest(dir, pkg string) error {
- out, err := exec.Command("go", "env", "GOEXE", "GOTMPDIR").Output()
+ out, err := exec.Command(gorootBinGo, "env", "GOEXE", "GOTMPDIR").Output()
if err != nil {
return err
}
diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go
index 8856f46..ee8ba91 100644
--- a/src/cmd/dist/util.go
+++ b/src/cmd/dist/util.go
@@ -71,7 +71,11 @@
errprintf("run: %s\n", strings.Join(cmd, " "))
}
- xcmd := exec.Command(cmd[0], cmd[1:]...)
+ bin := cmd[0]
+ if bin == "go" {
+ bin = gorootBinGo
+ }
+ xcmd := exec.Command(bin, cmd[1:]...)
setDir(xcmd, dir)
var data []byte
var err error
diff --git a/src/cmd/doc/dirs.go b/src/cmd/doc/dirs.go
index 489f490..60ad6d3 100644
--- a/src/cmd/doc/dirs.go
+++ b/src/cmd/doc/dirs.go
@@ -7,9 +7,9 @@
import (
"bytes"
"fmt"
- exec "internal/execabs"
"log"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"strings"
diff --git a/src/cmd/fix/typecheck.go b/src/cmd/fix/typecheck.go
index 8a18d61..015a0ee 100644
--- a/src/cmd/fix/typecheck.go
+++ b/src/cmd/fix/typecheck.go
@@ -9,8 +9,8 @@
"go/ast"
"go/parser"
"go/token"
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"reflect"
"runtime"
diff --git a/src/cmd/go/internal/base/base.go b/src/cmd/go/internal/base/base.go
index c2d4e6b..d4af4db 100644
--- a/src/cmd/go/internal/base/base.go
+++ b/src/cmd/go/internal/base/base.go
@@ -10,9 +10,9 @@
"context"
"flag"
"fmt"
- exec "internal/execabs"
"log"
"os"
+ "os/exec"
"strings"
"sync"
diff --git a/src/cmd/go/internal/bug/bug.go b/src/cmd/go/internal/bug/bug.go
index b4181b1..9c9e9dd 100644
--- a/src/cmd/go/internal/bug/bug.go
+++ b/src/cmd/go/internal/bug/bug.go
@@ -9,10 +9,10 @@
"bytes"
"context"
"fmt"
- exec "internal/execabs"
"io"
urlpkg "net/url"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"runtime"
diff --git a/src/cmd/go/internal/generate/generate.go b/src/cmd/go/internal/generate/generate.go
index a46f4f8..fe1e3d4 100644
--- a/src/cmd/go/internal/generate/generate.go
+++ b/src/cmd/go/internal/generate/generate.go
@@ -12,10 +12,10 @@
"fmt"
"go/parser"
"go/token"
- exec "internal/execabs"
"io"
"log"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"strconv"
diff --git a/src/cmd/go/internal/imports/build.go b/src/cmd/go/internal/imports/build.go
index 53fa196..0f20a87 100644
--- a/src/cmd/go/internal/imports/build.go
+++ b/src/cmd/go/internal/imports/build.go
@@ -328,6 +328,7 @@
"mips64le": true,
"mips64p32": true,
"mips64p32le": true,
+ "loong64": true,
"ppc": true,
"riscv": true,
"riscv64": true,
diff --git a/src/cmd/go/internal/modfetch/codehost/codehost.go b/src/cmd/go/internal/modfetch/codehost/codehost.go
index d8d4392..31dc811 100644
--- a/src/cmd/go/internal/modfetch/codehost/codehost.go
+++ b/src/cmd/go/internal/modfetch/codehost/codehost.go
@@ -10,10 +10,10 @@
"bytes"
"crypto/sha256"
"fmt"
- exec "internal/execabs"
"io"
"io/fs"
"os"
+ "os/exec"
"path/filepath"
"strings"
"sync"
diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go
index 34f453c..9c8fd42 100644
--- a/src/cmd/go/internal/modfetch/codehost/git.go
+++ b/src/cmd/go/internal/modfetch/codehost/git.go
@@ -8,11 +8,11 @@
"bytes"
"errors"
"fmt"
- exec "internal/execabs"
"io"
"io/fs"
"net/url"
"os"
+ "os/exec"
"path/filepath"
"sort"
"strconv"
diff --git a/src/cmd/go/internal/test/genflags.go b/src/cmd/go/internal/test/genflags.go
index 10f2900..f50ae5c 100644
--- a/src/cmd/go/internal/test/genflags.go
+++ b/src/cmd/go/internal/test/genflags.go
@@ -9,9 +9,9 @@
import (
"bytes"
"flag"
- exec "internal/execabs"
"log"
"os"
+ "os/exec"
"strings"
"testing"
"text/template"
diff --git a/src/cmd/go/internal/test/internal/genflags/vetflag.go b/src/cmd/go/internal/test/internal/genflags/vetflag.go
index 2195cc34..1448811 100644
--- a/src/cmd/go/internal/test/internal/genflags/vetflag.go
+++ b/src/cmd/go/internal/test/internal/genflags/vetflag.go
@@ -9,7 +9,7 @@
"cmd/go/internal/base"
"encoding/json"
"fmt"
- exec "internal/execabs"
+ "os/exec"
"regexp"
"sort"
)
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go
index 50e6d52..4adf3ac 100644
--- a/src/cmd/go/internal/test/test.go
+++ b/src/cmd/go/internal/test/test.go
@@ -11,10 +11,10 @@
"errors"
"fmt"
"go/build"
- exec "internal/execabs"
"io"
"io/fs"
"os"
+ "os/exec"
"path"
"path/filepath"
"regexp"
diff --git a/src/cmd/go/internal/tool/tool.go b/src/cmd/go/internal/tool/tool.go
index e8b5509..d61b524 100644
--- a/src/cmd/go/internal/tool/tool.go
+++ b/src/cmd/go/internal/tool/tool.go
@@ -8,8 +8,8 @@
import (
"context"
"fmt"
- exec "internal/execabs"
"os"
+ "os/exec"
"os/signal"
"sort"
"strings"
diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
index 7dbcfb7..4f16bef 100644
--- a/src/cmd/go/internal/vcs/vcs.go
+++ b/src/cmd/go/internal/vcs/vcs.go
@@ -8,13 +8,13 @@
"bytes"
"errors"
"fmt"
- exec "internal/execabs"
"internal/lazyregexp"
"internal/singleflight"
"io/fs"
"log"
urlpkg "net/url"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"strconv"
diff --git a/src/cmd/go/internal/vet/vetflag.go b/src/cmd/go/internal/vet/vetflag.go
index 8a55e9c..eb7af65 100644
--- a/src/cmd/go/internal/vet/vetflag.go
+++ b/src/cmd/go/internal/vet/vetflag.go
@@ -10,9 +10,9 @@
"errors"
"flag"
"fmt"
- exec "internal/execabs"
"log"
"os"
+ "os/exec"
"path/filepath"
"strings"
diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
index e9a8ee6..2f3c8c7 100644
--- a/src/cmd/go/internal/work/build.go
+++ b/src/cmd/go/internal/work/build.go
@@ -9,8 +9,8 @@
"errors"
"fmt"
"go/build"
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"runtime"
"strconv"
diff --git a/src/cmd/go/internal/work/buildid.go b/src/cmd/go/internal/work/buildid.go
index ac98aa3..846e2c8 100644
--- a/src/cmd/go/internal/work/buildid.go
+++ b/src/cmd/go/internal/work/buildid.go
@@ -7,8 +7,8 @@
import (
"bytes"
"fmt"
- exec "internal/execabs"
"os"
+ "os/exec"
"strings"
"cmd/go/internal/base"
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 6ecd4dc..15b9e1e 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -12,13 +12,13 @@
"encoding/json"
"errors"
"fmt"
- exec "internal/execabs"
"internal/lazyregexp"
"io"
"io/fs"
"log"
"math/rand"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"runtime"
@@ -2655,6 +2655,8 @@
} else if cfg.GOMIPS == "softfloat" {
return append(args, "-msoft-float")
}
+ case "loong64":
+ return []string{"-mabi=lp64d"}
case "ppc64":
if cfg.Goos == "aix" {
return []string{"-maix64"}
diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go
index 1499536..cfd9bcc 100644
--- a/src/cmd/go/internal/work/gccgo.go
+++ b/src/cmd/go/internal/work/gccgo.go
@@ -6,8 +6,8 @@
import (
"fmt"
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"strings"
"sync"
diff --git a/src/cmd/go/testdata/addmod.go b/src/cmd/go/testdata/addmod.go
index 41997a5..e378d7f 100644
--- a/src/cmd/go/testdata/addmod.go
+++ b/src/cmd/go/testdata/addmod.go
@@ -23,11 +23,11 @@
"bytes"
"flag"
"fmt"
- exec "internal/execabs"
"internal/txtar"
"io/fs"
"log"
"os"
+ "os/exec"
"path/filepath"
"strings"
)
diff --git a/src/cmd/go/testdata/script/cgo_path.txt b/src/cmd/go/testdata/script/cgo_path.txt
index be9609e..1f84dbc 100644
--- a/src/cmd/go/testdata/script/cgo_path.txt
+++ b/src/cmd/go/testdata/script/cgo_path.txt
@@ -14,7 +14,7 @@
[windows] exists -exec p/gcc.bat p/clang.bat
! exists p/bug.txt
! go build -x
-stderr '^cgo: exec (clang|gcc): (clang|gcc) resolves to executable relative to current directory \(.[/\\](clang|gcc)(.bat)?\)$'
+stderr '^cgo: C compiler "(clang|gcc)" not found: exec: "(clang|gcc)": cannot run executable found relative to current directory'
! exists p/bug.txt
-- go.mod --
diff --git a/src/cmd/internal/browser/browser.go b/src/cmd/internal/browser/browser.go
index 577d317..6867c85 100644
--- a/src/cmd/internal/browser/browser.go
+++ b/src/cmd/internal/browser/browser.go
@@ -6,8 +6,8 @@
package browser
import (
- exec "internal/execabs"
"os"
+ "os/exec"
"runtime"
"time"
)
diff --git a/src/cmd/internal/dwarf/dwarf.go b/src/cmd/internal/dwarf/dwarf.go
index be37641..8ba5737 100644
--- a/src/cmd/internal/dwarf/dwarf.go
+++ b/src/cmd/internal/dwarf/dwarf.go
@@ -12,7 +12,7 @@
"errors"
"fmt"
"internal/buildcfg"
- exec "internal/execabs"
+ "os/exec"
"sort"
"strconv"
"strings"
diff --git a/src/cmd/internal/notsha256/sha256block_arm64.s b/src/cmd/internal/notsha256/sha256block_arm64.s
deleted file mode 100644
index d5c1eb0b..0000000
--- a/src/cmd/internal/notsha256/sha256block_arm64.s
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "textflag.h"
-
-#define HASHUPDATE \
- SHA256H V9.S4, V3, V2 \
- SHA256H2 V9.S4, V8, V3 \
- VMOV V2.B16, V8.B16
-
-// func sha256block(h []uint32, p []byte, k []uint32)
-TEXT ·sha256block(SB),NOSPLIT,$0
- MOVD h_base+0(FP), R0 // Hash value first address
- MOVD p_base+24(FP), R1 // message first address
- MOVD k_base+48(FP), R2 // k constants first address
- MOVD p_len+32(FP), R3 // message length
- VLD1 (R0), [V0.S4, V1.S4] // load h(a,b,c,d,e,f,g,h)
- VLD1.P 64(R2), [V16.S4, V17.S4, V18.S4, V19.S4]
- VLD1.P 64(R2), [V20.S4, V21.S4, V22.S4, V23.S4]
- VLD1.P 64(R2), [V24.S4, V25.S4, V26.S4, V27.S4]
- VLD1 (R2), [V28.S4, V29.S4, V30.S4, V31.S4] //load 64*4bytes K constant(K0-K63)
-
-blockloop:
-
- VLD1.P 16(R1), [V4.B16] // load 16bytes message
- VLD1.P 16(R1), [V5.B16] // load 16bytes message
- VLD1.P 16(R1), [V6.B16] // load 16bytes message
- VLD1.P 16(R1), [V7.B16] // load 16bytes message
- VMOV V0.B16, V2.B16 // backup: VO h(dcba)
- VMOV V1.B16, V3.B16 // backup: V1 h(hgfe)
- VMOV V2.B16, V8.B16
- VREV32 V4.B16, V4.B16 // prepare for using message in Byte format
- VREV32 V5.B16, V5.B16
- VREV32 V6.B16, V6.B16
- VREV32 V7.B16, V7.B16
-
- VADD V16.S4, V4.S4, V9.S4 // V18(W0+K0...W3+K3)
- SHA256SU0 V5.S4, V4.S4 // V4: (su0(W1)+W0,...,su0(W4)+W3)
- HASHUPDATE // H4
-
- VADD V17.S4, V5.S4, V9.S4 // V18(W4+K4...W7+K7)
- SHA256SU0 V6.S4, V5.S4 // V5: (su0(W5)+W4,...,su0(W8)+W7)
- SHA256SU1 V7.S4, V6.S4, V4.S4 // V4: W16-W19
- HASHUPDATE // H8
-
- VADD V18.S4, V6.S4, V9.S4 // V18(W8+K8...W11+K11)
- SHA256SU0 V7.S4, V6.S4 // V6: (su0(W9)+W8,...,su0(W12)+W11)
- SHA256SU1 V4.S4, V7.S4, V5.S4 // V5: W20-W23
- HASHUPDATE // H12
-
- VADD V19.S4, V7.S4, V9.S4 // V18(W12+K12...W15+K15)
- SHA256SU0 V4.S4, V7.S4 // V7: (su0(W13)+W12,...,su0(W16)+W15)
- SHA256SU1 V5.S4, V4.S4, V6.S4 // V6: W24-W27
- HASHUPDATE // H16
-
- VADD V20.S4, V4.S4, V9.S4 // V18(W16+K16...W19+K19)
- SHA256SU0 V5.S4, V4.S4 // V4: (su0(W17)+W16,...,su0(W20)+W19)
- SHA256SU1 V6.S4, V5.S4, V7.S4 // V7: W28-W31
- HASHUPDATE // H20
-
- VADD V21.S4, V5.S4, V9.S4 // V18(W20+K20...W23+K23)
- SHA256SU0 V6.S4, V5.S4 // V5: (su0(W21)+W20,...,su0(W24)+W23)
- SHA256SU1 V7.S4, V6.S4, V4.S4 // V4: W32-W35
- HASHUPDATE // H24
-
- VADD V22.S4, V6.S4, V9.S4 // V18(W24+K24...W27+K27)
- SHA256SU0 V7.S4, V6.S4 // V6: (su0(W25)+W24,...,su0(W28)+W27)
- SHA256SU1 V4.S4, V7.S4, V5.S4 // V5: W36-W39
- HASHUPDATE // H28
-
- VADD V23.S4, V7.S4, V9.S4 // V18(W28+K28...W31+K31)
- SHA256SU0 V4.S4, V7.S4 // V7: (su0(W29)+W28,...,su0(W32)+W31)
- SHA256SU1 V5.S4, V4.S4, V6.S4 // V6: W40-W43
- HASHUPDATE // H32
-
- VADD V24.S4, V4.S4, V9.S4 // V18(W32+K32...W35+K35)
- SHA256SU0 V5.S4, V4.S4 // V4: (su0(W33)+W32,...,su0(W36)+W35)
- SHA256SU1 V6.S4, V5.S4, V7.S4 // V7: W44-W47
- HASHUPDATE // H36
-
- VADD V25.S4, V5.S4, V9.S4 // V18(W36+K36...W39+K39)
- SHA256SU0 V6.S4, V5.S4 // V5: (su0(W37)+W36,...,su0(W40)+W39)
- SHA256SU1 V7.S4, V6.S4, V4.S4 // V4: W48-W51
- HASHUPDATE // H40
-
- VADD V26.S4, V6.S4, V9.S4 // V18(W40+K40...W43+K43)
- SHA256SU0 V7.S4, V6.S4 // V6: (su0(W41)+W40,...,su0(W44)+W43)
- SHA256SU1 V4.S4, V7.S4, V5.S4 // V5: W52-W55
- HASHUPDATE // H44
-
- VADD V27.S4, V7.S4, V9.S4 // V18(W44+K44...W47+K47)
- SHA256SU0 V4.S4, V7.S4 // V7: (su0(W45)+W44,...,su0(W48)+W47)
- SHA256SU1 V5.S4, V4.S4, V6.S4 // V6: W56-W59
- HASHUPDATE // H48
-
- VADD V28.S4, V4.S4, V9.S4 // V18(W48+K48,...,W51+K51)
- HASHUPDATE // H52
- SHA256SU1 V6.S4, V5.S4, V7.S4 // V7: W60-W63
-
- VADD V29.S4, V5.S4, V9.S4 // V18(W52+K52,...,W55+K55)
- HASHUPDATE // H56
-
- VADD V30.S4, V6.S4, V9.S4 // V18(W59+K59,...,W59+K59)
- HASHUPDATE // H60
-
- VADD V31.S4, V7.S4, V9.S4 // V18(W60+K60,...,W63+K63)
- HASHUPDATE // H64
-
- SUB $64, R3, R3 // message length - 64bytes, then compare with 64bytes
- VADD V2.S4, V0.S4, V0.S4
- VADD V3.S4, V1.S4, V1.S4
- CBNZ R3, blockloop
-
-sha256ret:
-
- VST1 [V0.S4, V1.S4], (R0) // store hash value H
- RET
-
diff --git a/src/cmd/internal/objabi/reloctype.go b/src/cmd/internal/objabi/reloctype.go
index a9c3030..f60cac2 100644
--- a/src/cmd/internal/objabi/reloctype.go
+++ b/src/cmd/internal/objabi/reloctype.go
@@ -250,6 +250,32 @@
// TODO(mundaym): remove once variants can be serialized - see issue 14218.
R_PCRELDBL
+ // Loong64.
+
+ // R_ADDRLOONG64 resolves to the low 12 bits of an external address, by encoding
+ // it into the instruction.
+ R_ADDRLOONG64
+
+ // R_ADDRLOONG64U resolves to the sign-adjusted "upper" 20 bits (bit 5-24) of an
+ // external address, by encoding it into the instruction.
+ R_ADDRLOONG64U
+
+ // R_ADDRLOONG64TLS resolves to the low 12 bits of a TLS address (offset from
+ // thread pointer), by encoding it into the instruction.
+ R_ADDRLOONG64TLS
+
+ // R_ADDRLOONG64TLSU resolves to the high 20 bits of a TLS address (offset from
+ // thread pointer), by encoding it into the instruction.
+ R_ADDRLOONG64TLSU
+
+ // R_CALLLOONG64 resolves to non-PC-relative target address of a CALL (BL/JIRL)
+ // instruction, by encoding the address into the instruction.
+ R_CALLLOONG64
+
+ // R_JMPLOONG64 resolves to non-PC-relative target address of a JMP instruction,
+ // by encoding the address into the instruction.
+ R_JMPLOONG64
+
// R_ADDRMIPSU (only used on mips/mips64) resolves to the sign-adjusted "upper" 16
// bits (bit 16-31) of an external address, by encoding it into the instruction.
R_ADDRMIPSU
@@ -286,7 +312,7 @@
// the target address in register or memory.
func (r RelocType) IsDirectCall() bool {
switch r {
- case R_CALL, R_CALLARM, R_CALLARM64, R_CALLMIPS, R_CALLPOWER, R_RISCV_CALL, R_RISCV_CALL_TRAMP:
+ case R_CALL, R_CALLARM, R_CALLARM64, R_CALLLOONG64, R_CALLMIPS, R_CALLPOWER, R_RISCV_CALL, R_RISCV_CALL_TRAMP:
return true
}
return false
@@ -301,6 +327,8 @@
switch r {
case R_JMPMIPS:
return true
+ case R_JMPLOONG64:
+ return true
}
return false
}
diff --git a/src/cmd/internal/objabi/reloctype_string.go b/src/cmd/internal/objabi/reloctype_string.go
index d1b15b5..9756f2a 100644
--- a/src/cmd/internal/objabi/reloctype_string.go
+++ b/src/cmd/internal/objabi/reloctype_string.go
@@ -65,16 +65,22 @@
_ = x[R_RISCV_TLS_IE_ITYPE-55]
_ = x[R_RISCV_TLS_IE_STYPE-56]
_ = x[R_PCRELDBL-57]
- _ = x[R_ADDRMIPSU-58]
- _ = x[R_ADDRMIPSTLS-59]
- _ = x[R_ADDRCUOFF-60]
- _ = x[R_WASMIMPORT-61]
- _ = x[R_XCOFFREF-62]
+ _ = x[R_ADDRLOONG64-58]
+ _ = x[R_ADDRLOONG64U-59]
+ _ = x[R_ADDRLOONG64TLS-60]
+ _ = x[R_ADDRLOONG64TLSU-61]
+ _ = x[R_CALLLOONG64-62]
+ _ = x[R_JMPLOONG64-63]
+ _ = x[R_ADDRMIPSU-64]
+ _ = x[R_ADDRMIPSTLS-65]
+ _ = x[R_ADDRCUOFF-66]
+ _ = x[R_WASMIMPORT-67]
+ _ = x[R_XCOFFREF-68]
}
-const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_USEIFACER_USEIFACEMETHODR_USEGENERICIFACEMETHODR_METHODOFFR_KEEPR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFSECREFR_DWARFFILEREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_ARM64_GOTR_ARM64_PCRELR_ARM64_LDST8R_ARM64_LDST16R_ARM64_LDST32R_ARM64_LDST64R_ARM64_LDST128R_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_RISCV_CALLR_RISCV_CALL_TRAMPR_RISCV_PCREL_ITYPER_RISCV_PCREL_STYPER_RISCV_TLS_IE_ITYPER_RISCV_TLS_IE_STYPER_PCRELDBLR_ADDRMIPSUR_ADDRMIPSTLSR_ADDRCUOFFR_WASMIMPORTR_XCOFFREF"
+const _RelocType_name = "R_ADDRR_ADDRPOWERR_ADDRARM64R_ADDRMIPSR_ADDROFFR_SIZER_CALLR_CALLARMR_CALLARM64R_CALLINDR_CALLPOWERR_CALLMIPSR_CONSTR_PCRELR_TLS_LER_TLS_IER_GOTOFFR_PLT0R_PLT1R_PLT2R_USEFIELDR_USETYPER_USEIFACER_USEIFACEMETHODR_USEGENERICIFACEMETHODR_METHODOFFR_KEEPR_POWER_TOCR_GOTPCRELR_JMPMIPSR_DWARFSECREFR_DWARFFILEREFR_ARM64_TLS_LER_ARM64_TLS_IER_ARM64_GOTPCRELR_ARM64_GOTR_ARM64_PCRELR_ARM64_LDST8R_ARM64_LDST16R_ARM64_LDST32R_ARM64_LDST64R_ARM64_LDST128R_POWER_TLS_LER_POWER_TLS_IER_POWER_TLSR_ADDRPOWER_DSR_ADDRPOWER_GOTR_ADDRPOWER_PCRELR_ADDRPOWER_TOCRELR_ADDRPOWER_TOCREL_DSR_RISCV_CALLR_RISCV_CALL_TRAMPR_RISCV_PCREL_ITYPER_RISCV_PCREL_STYPER_RISCV_TLS_IE_ITYPER_RISCV_TLS_IE_STYPER_PCRELDBLR_ADDRLOONG64R_ADDRLOONG64UR_ADDRLOONG64TLSR_ADDRLOONG64TLSUR_CALLLOONG64R_JMPLOONG64R_ADDRMIPSUR_ADDRMIPSTLSR_ADDRCUOFFR_WASMIMPORTR_XCOFFREF"
-var _RelocType_index = [...]uint16{0, 6, 17, 28, 38, 47, 53, 59, 68, 79, 88, 99, 109, 116, 123, 131, 139, 147, 153, 159, 165, 175, 184, 194, 210, 233, 244, 250, 261, 271, 280, 293, 307, 321, 335, 351, 362, 375, 388, 402, 416, 430, 445, 459, 473, 484, 498, 513, 530, 548, 569, 581, 599, 618, 637, 657, 677, 687, 698, 711, 722, 734, 744}
+var _RelocType_index = [...]uint16{0, 6, 17, 28, 38, 47, 53, 59, 68, 79, 88, 99, 109, 116, 123, 131, 139, 147, 153, 159, 165, 175, 184, 194, 210, 233, 244, 250, 261, 271, 280, 293, 307, 321, 335, 351, 362, 375, 388, 402, 416, 430, 445, 459, 473, 484, 498, 513, 530, 548, 569, 581, 599, 618, 637, 657, 677, 687, 700, 714, 730, 747, 760, 772, 783, 796, 807, 819, 829}
func (i RelocType) String() string {
i -= 1
diff --git a/src/cmd/internal/pkgpath/pkgpath.go b/src/cmd/internal/pkgpath/pkgpath.go
index 72e3bdb..40a040a 100644
--- a/src/cmd/internal/pkgpath/pkgpath.go
+++ b/src/cmd/internal/pkgpath/pkgpath.go
@@ -10,9 +10,9 @@
"bytes"
"errors"
"fmt"
- exec "internal/execabs"
"io/ioutil"
"os"
+ "os/exec"
"strings"
)
diff --git a/src/cmd/link/internal/ld/execarchive.go b/src/cmd/link/internal/ld/execarchive.go
index 918b86c..a9376e9 100644
--- a/src/cmd/link/internal/ld/execarchive.go
+++ b/src/cmd/link/internal/ld/execarchive.go
@@ -8,8 +8,8 @@
package ld
import (
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"syscall"
)
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index 680f509..04b2556 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -49,11 +49,11 @@
"encoding/binary"
"fmt"
"internal/buildcfg"
- exec "internal/execabs"
"io"
"io/ioutil"
"log"
"os"
+ "os/exec"
"path/filepath"
"runtime"
"strings"
diff --git a/src/cmd/test2json/main.go b/src/cmd/test2json/main.go
index b1c2d06..5e17e0d 100644
--- a/src/cmd/test2json/main.go
+++ b/src/cmd/test2json/main.go
@@ -85,9 +85,9 @@
import (
"flag"
"fmt"
- exec "internal/execabs"
"io"
"os"
+ "os/exec"
"cmd/internal/test2json"
)
diff --git a/src/cmd/trace/pprof.go b/src/cmd/trace/pprof.go
index c4d3742..a73ff53 100644
--- a/src/cmd/trace/pprof.go
+++ b/src/cmd/trace/pprof.go
@@ -9,11 +9,11 @@
import (
"bufio"
"fmt"
- exec "internal/execabs"
"internal/trace"
"io"
"net/http"
"os"
+ "os/exec"
"path/filepath"
"runtime"
"sort"
diff --git a/src/compress/flate/deflate.go b/src/compress/flate/deflate.go
index 5500321..4ca20b8 100644
--- a/src/compress/flate/deflate.go
+++ b/src/compress/flate/deflate.go
@@ -5,6 +5,7 @@
package flate
import (
+ "errors"
"fmt"
"io"
"math"
@@ -639,6 +640,9 @@
}
func (d *compressor) close() error {
+ if d.err == errWriterClosed {
+ return nil
+ }
if d.err != nil {
return d.err
}
@@ -651,7 +655,11 @@
return d.w.err
}
d.w.flush()
- return d.w.err
+ if d.w.err != nil {
+ return d.w.err
+ }
+ d.err = errWriterClosed
+ return nil
}
// NewWriter returns a new Writer compressing data at the given level.
@@ -699,6 +707,8 @@
return w.w.Write(b)
}
+var errWriterClosed = errors.New("flate: closed writer")
+
// A Writer takes data written to it and writes the compressed
// form of that data to an underlying writer (see NewWriter).
type Writer struct {
diff --git a/src/compress/flate/deflate_test.go b/src/compress/flate/deflate_test.go
index ff56712..6d20430 100644
--- a/src/compress/flate/deflate_test.go
+++ b/src/compress/flate/deflate_test.go
@@ -125,6 +125,40 @@
}
}
+func TestWriterClose(t *testing.T) {
+ b := new(bytes.Buffer)
+ zw, err := NewWriter(b, 6)
+ if err != nil {
+ t.Fatalf("NewWriter: %v", err)
+ }
+
+ if c, err := zw.Write([]byte("Test")); err != nil || c != 4 {
+ t.Fatalf("Write to not closed writer: %s, %d", err, c)
+ }
+
+ if err := zw.Close(); err != nil {
+ t.Fatalf("Close: %v", err)
+ }
+
+ afterClose := b.Len()
+
+ if c, err := zw.Write([]byte("Test")); err == nil || c != 0 {
+ t.Fatalf("Write to closed writer: %v, %d", err, c)
+ }
+
+ if err := zw.Flush(); err == nil {
+ t.Fatalf("Flush to closed writer: %s", err)
+ }
+
+ if err := zw.Close(); err != nil {
+ t.Fatalf("Close: %v", err)
+ }
+
+ if afterClose != b.Len() {
+ t.Fatalf("Writer wrote data after close. After close: %d. After writes on closed stream: %d", afterClose, b.Len())
+ }
+}
+
// A sparseReader returns a stream consisting of 0s followed by 1<<16 1s.
// This tests missing hash references in a very large input.
type sparseReader struct {
@@ -683,7 +717,7 @@
return len(b), nil
}
-func TestWriterPersistentError(t *testing.T) {
+func TestWriterPersistentWriteError(t *testing.T) {
t.Parallel()
d, err := os.ReadFile("../../testdata/Isaac.Newton-Opticks.txt")
if err != nil {
@@ -706,12 +740,16 @@
_, werr := zw.Write(d)
cerr := zw.Close()
+ ferr := zw.Flush()
if werr != errIO && werr != nil {
t.Errorf("test %d, mismatching Write error: got %v, want %v", i, werr, errIO)
}
if cerr != errIO && fw.n < 0 {
t.Errorf("test %d, mismatching Close error: got %v, want %v", i, cerr, errIO)
}
+ if ferr != errIO && fw.n < 0 {
+ t.Errorf("test %d, mismatching Flush error: got %v, want %v", i, ferr, errIO)
+ }
if fw.n >= 0 {
// At this point, the failure threshold was sufficiently high enough
// that we wrote the whole stream without any errors.
@@ -719,6 +757,54 @@
}
}
}
+func TestWriterPersistentFlushError(t *testing.T) {
+ zw, err := NewWriter(&failWriter{0}, DefaultCompression)
+ if err != nil {
+ t.Fatalf("NewWriter: %v", err)
+ }
+ flushErr := zw.Flush()
+ closeErr := zw.Close()
+ _, writeErr := zw.Write([]byte("Test"))
+ checkErrors([]error{closeErr, flushErr, writeErr}, errIO, t)
+}
+
+func TestWriterPersistentCloseError(t *testing.T) {
+ // If underlying writer return error on closing stream we should persistent this error across all writer calls.
+ zw, err := NewWriter(&failWriter{0}, DefaultCompression)
+ if err != nil {
+ t.Fatalf("NewWriter: %v", err)
+ }
+ closeErr := zw.Close()
+ flushErr := zw.Flush()
+ _, writeErr := zw.Write([]byte("Test"))
+ checkErrors([]error{closeErr, flushErr, writeErr}, errIO, t)
+
+ // After closing writer we should persistent "write after close" error across Flush and Write calls, but return nil
+ // on next Close calls.
+ var b bytes.Buffer
+ zw.Reset(&b)
+ err = zw.Close()
+ if err != nil {
+ t.Fatalf("First call to close returned error: %s", err)
+ }
+ err = zw.Close()
+ if err != nil {
+ t.Fatalf("Second call to close returned error: %s", err)
+ }
+
+ flushErr = zw.Flush()
+ _, writeErr = zw.Write([]byte("Test"))
+ checkErrors([]error{flushErr, writeErr}, errWriterClosed, t)
+}
+
+func checkErrors(got []error, want error, t *testing.T) {
+ t.Helper()
+ for _, err := range got {
+ if err != want {
+ t.Errorf("Errors dosn't match\nWant: %s\nGot: %s", want, got)
+ }
+ }
+}
func TestBestSpeedMatch(t *testing.T) {
t.Parallel()
diff --git a/src/crypto/ecdsa/ecdsa_test.go b/src/crypto/ecdsa/ecdsa_test.go
index c8390b2..77a8134 100644
--- a/src/crypto/ecdsa/ecdsa_test.go
+++ b/src/crypto/ecdsa/ecdsa_test.go
@@ -327,7 +327,7 @@
}
}
-func benchmarkAllCurves(t *testing.B, f func(*testing.B, elliptic.Curve)) {
+func benchmarkAllCurves(b *testing.B, f func(*testing.B, elliptic.Curve)) {
tests := []struct {
name string
curve elliptic.Curve
@@ -339,8 +339,8 @@
}
for _, test := range tests {
curve := test.curve
- t.Run(test.name, func(t *testing.B) {
- f(t, curve)
+ b.Run(test.name, func(b *testing.B) {
+ f(b, curve)
})
}
}
diff --git a/src/crypto/ed25519/internal/edwards25519/scalarmult_test.go b/src/crypto/ed25519/internal/edwards25519/scalarmult_test.go
index c2027f5..1760603 100644
--- a/src/crypto/ed25519/internal/edwards25519/scalarmult_test.go
+++ b/src/crypto/ed25519/internal/edwards25519/scalarmult_test.go
@@ -184,26 +184,26 @@
// Benchmarks.
-func BenchmarkScalarBaseMult(t *testing.B) {
+func BenchmarkScalarBaseMult(b *testing.B) {
var p Point
- for i := 0; i < t.N; i++ {
+ for i := 0; i < b.N; i++ {
p.ScalarBaseMult(&dalekScalar)
}
}
-func BenchmarkScalarMult(t *testing.B) {
+func BenchmarkScalarMult(b *testing.B) {
var p Point
- for i := 0; i < t.N; i++ {
+ for i := 0; i < b.N; i++ {
p.ScalarMult(&dalekScalar, B)
}
}
-func BenchmarkVarTimeDoubleScalarBaseMult(t *testing.B) {
+func BenchmarkVarTimeDoubleScalarBaseMult(b *testing.B) {
var p Point
- for i := 0; i < t.N; i++ {
+ for i := 0; i < b.N; i++ {
p.VarTimeDoubleScalarBaseMult(&dalekScalar, B, &dalekScalar)
}
}
diff --git a/src/crypto/elliptic/elliptic_test.go b/src/crypto/elliptic/elliptic_test.go
index eb5f054..6a79b82 100644
--- a/src/crypto/elliptic/elliptic_test.go
+++ b/src/crypto/elliptic/elliptic_test.go
@@ -305,7 +305,7 @@
})
}
-func benchmarkAllCurves(t *testing.B, f func(*testing.B, Curve)) {
+func benchmarkAllCurves(b *testing.B, f func(*testing.B, Curve)) {
tests := []struct {
name string
curve Curve
@@ -317,8 +317,8 @@
}
for _, test := range tests {
curve := test.curve
- t.Run(test.name, func(t *testing.B) {
- f(t, curve)
+ b.Run(test.name, func(b *testing.B) {
+ f(b, curve)
})
}
}
diff --git a/src/go.mod b/src/go.mod
index 8830dc0..e154bef 100644
--- a/src/go.mod
+++ b/src/go.mod
@@ -4,7 +4,7 @@
require (
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
- golang.org/x/net v0.0.0-20220225172249-27dd8689420f
+ golang.org/x/net v0.0.0-20220421235706-1d1ef9303861
)
require (
diff --git a/src/go.sum b/src/go.sum
index 70a22b9..a804d39 100644
--- a/src/go.sum
+++ b/src/go.sum
@@ -1,7 +1,7 @@
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 h1:yssD99+7tqHWO5Gwh81phT+67hg+KttniBr6UnEXOY8=
+golang.org/x/net v0.0.0-20220421235706-1d1ef9303861/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf h1:Fm4IcnUL803i92qDlmB0obyHmosDrxZWxJL3gIeNqOw=
golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.8-0.20220124021120-d1c84af989ab h1:eHo2TTVBaAPw9lDGK2Gb9GyPMXT6g7O63W6sx3ylbzU=
diff --git a/src/go/build/build.go b/src/go/build/build.go
index b373fea..836e279 100644
--- a/src/go/build/build.go
+++ b/src/go/build/build.go
@@ -13,13 +13,13 @@
"go/doc"
"go/token"
"internal/buildcfg"
- exec "internal/execabs"
"internal/goroot"
"internal/goversion"
"io"
"io/fs"
"io/ioutil"
"os"
+ "os/exec"
pathpkg "path"
"path/filepath"
"runtime"
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go
index 91220a8..8519b82 100644
--- a/src/go/build/deps_test.go
+++ b/src/go/build/deps_test.go
@@ -203,15 +203,10 @@
log !< FMT;
- OS, FMT
- < internal/execabs;
-
- OS, internal/execabs
- < internal/goroot;
-
# Misc packages needing only FMT.
FMT
< html,
+ internal/goroot,
mime/quotedprintable,
net/internal/socktest,
net/url,
diff --git a/src/go/internal/gccgoimporter/gccgoinstallation.go b/src/go/internal/gccgoimporter/gccgoinstallation.go
index e90a3cc..8fc7ce3 100644
--- a/src/go/internal/gccgoimporter/gccgoinstallation.go
+++ b/src/go/internal/gccgoimporter/gccgoinstallation.go
@@ -7,8 +7,8 @@
import (
"bufio"
"go/types"
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"strings"
)
diff --git a/src/go/internal/gcimporter/ureader.go b/src/go/internal/gcimporter/ureader.go
index 5260759..e27d3e0 100644
--- a/src/go/internal/gcimporter/ureader.go
+++ b/src/go/internal/gcimporter/ureader.go
@@ -184,14 +184,13 @@
func (r *reader) doPkg() *types.Package {
path := r.String()
- if path == "builtin" {
- return nil // universe
- }
- if path == "unsafe" {
- return types.Unsafe
- }
- if path == "" {
+ switch path {
+ case "":
path = r.p.PkgPath()
+ case "builtin":
+ return nil // universe
+ case "unsafe":
+ return types.Unsafe
}
if pkg := r.p.imports[path]; pkg != nil {
diff --git a/src/go/internal/srcimporter/srcimporter.go b/src/go/internal/srcimporter/srcimporter.go
index ea6f012..caf76a2 100644
--- a/src/go/internal/srcimporter/srcimporter.go
+++ b/src/go/internal/srcimporter/srcimporter.go
@@ -13,9 +13,9 @@
"go/parser"
"go/token"
"go/types"
- exec "internal/execabs"
"io"
"os"
+ "os/exec"
"path/filepath"
"strings"
"sync"
diff --git a/src/internal/bytealg/equal_ppc64x.s b/src/internal/bytealg/equal_ppc64x.s
index 8c9443d..f2c7cc1 100644
--- a/src/internal/bytealg/equal_ppc64x.s
+++ b/src/internal/bytealg/equal_ppc64x.s
@@ -7,6 +7,21 @@
#include "go_asm.h"
#include "textflag.h"
+// 4K (smallest case) page size offset mask for PPC64.
+#define PAGE_OFFSET 4095
+
+// TODO: At writing, ISEL and BC do not support CR bit type arguments,
+// define them here for readability.
+#define CR0LT 4*0+0
+#define CR0EQ 4*0+2
+#define CR1LT 4*1+0
+#define CR6LT 4*6+0
+
+// Likewise, the BC opcode is hard to read, and no extended
+// mnemonics are offered for these forms.
+#define BGELR_CR6 BC 4, CR6LT, (LR)
+#define BEQLR BC 12, CR0EQ, (LR)
+
// memequal(a, b unsafe.Pointer, size uintptr) bool
TEXT runtime·memequal<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-25
// R3 = a
@@ -33,66 +48,158 @@
// On exit:
// R3 = return value
TEXT memeqbody<>(SB),NOSPLIT|NOFRAME,$0-0
- MOVD R5,CTR
- CMP R5,$8 // only optimize >=8
- BLT simplecheck
- DCBT (R3) // cache hint
- DCBT (R4)
- CMP R5,$32 // optimize >= 32
- MOVD R5,R6 // needed if setup8a branch
- BLT setup8a // 8 byte moves only
-setup32a: // 8 byte aligned, >= 32 bytes
- SRADCC $5,R5,R6 // number of 32 byte chunks to compare
- MOVD R6,CTR
- MOVD $16,R14 // index for VSX loads and stores
-loop32a:
- LXVD2X (R3+R0), VS32 // VS32 = V0
- LXVD2X (R4+R0), VS33 // VS33 = V1
+ MOVD R3, R8 // Move s1 into R8
+ ADD R5, R3, R9 // &s1[len(s1)]
+ ADD R5, R4, R10 // &s2[len(s2)]
+ MOVD $1, R11
+ CMP R5, $16 // Use GPR checks for check for len <= 16
+ BLE check0_16
+ MOVD $0, R3 // Assume no-match in case BGELR CR6 returns
+ CMP R5, $32 // Use overlapping VSX loads for len <= 32
+ BLE check17_32 // Do a pair of overlapping VSR compares
+ CMP R5, $64
+ BLE check33_64 // Hybrid check + overlap compare.
+
+setup64:
+ SRD $6, R5, R6 // number of 64 byte chunks to compare
+ MOVD R6, CTR
+ MOVD $16, R14 // index for VSX loads and stores
+ MOVD $32, R15
+ MOVD $48, R16
+ ANDCC $0x3F, R5, R5 // len%64==0?
+
+ PCALIGN $32
+loop64:
+ LXVD2X (R8+R0), V0
+ LXVD2X (R4+R0), V1
VCMPEQUBCC V0, V1, V2 // compare, setting CR6
- BGE CR6, noteq
- LXVD2X (R3+R14), VS32
- LXVD2X (R4+R14), VS33
- VCMPEQUBCC V0, V1, V2
- BGE CR6, noteq
- ADD $32,R3 // bump up to next 32
- ADD $32,R4
- BC 16, 0, loop32a // br ctr and cr
- ANDCC $24,R5,R6 // Any 8 byte chunks?
- BEQ leftover // and result is 0
-setup8a:
- SRADCC $3,R6,R6 // get the 8 byte count
- BEQ leftover // shifted value is 0
- MOVD R6,CTR
-loop8:
- MOVD 0(R3),R6 // doublewords to compare
- ADD $8,R3
- MOVD 0(R4),R7
- ADD $8,R4
- CMP R6,R7 // match?
- BC 8,2,loop8 // bt ctr <> 0 && cr
- BNE noteq
-leftover:
- ANDCC $7,R5,R6 // check for leftover bytes
- BEQ equal
- MOVD R6,CTR
- BR simple
-simplecheck:
- CMP R5,$0
- BEQ equal
-simple:
- MOVBZ 0(R3), R6
- ADD $1,R3
- MOVBZ 0(R4), R7
- ADD $1,R4
- CMP R6, R7
- BNE noteq
- BC 8,2,simple
- BNE noteq
- BR equal
-noteq:
- MOVD $0, R3
- RET
-equal:
- MOVD $1, R3
+ BGELR_CR6
+ LXVD2X (R8+R14), V0
+ LXVD2X (R4+R14), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ LXVD2X (R8+R15), V0
+ LXVD2X (R4+R15), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ LXVD2X (R8+R16), V0
+ LXVD2X (R4+R16), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ ADD $64,R8 // bump up to next 64
+ ADD $64,R4
+ BDNZ loop64
+
+ ISEL $CR0EQ, R11, R3, R3 // If no tail, return 1, otherwise R3 remains 0.
+ BEQLR // return if no tail.
+
+ ADD $-64, R9, R8
+ ADD $-64, R10, R4
+ LXVD2X (R8+R0), V0
+ LXVD2X (R4+R0), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ LXVD2X (R8+R14), V0
+ LXVD2X (R4+R14), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ LXVD2X (R8+R15), V0
+ LXVD2X (R4+R15), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ LXVD2X (R8+R16), V0
+ LXVD2X (R4+R16), V1
+ VCMPEQUBCC V0, V1, V2
+ ISEL $CR6LT, R11, R0, R3
RET
+check33_64:
+ // Bytes 0-15
+ LXVD2X (R8+R0), V0
+ LXVD2X (R4+R0), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+ ADD $16, R8
+ ADD $16, R4
+
+ // Bytes 16-31
+ LXVD2X (R8+R0), V0
+ LXVD2X (R4+R0), V1
+ VCMPEQUBCC V0, V1, V2
+ BGELR_CR6
+
+ // A little tricky, but point R4,R8 to &sx[len-32],
+ // and reuse check17_32 to check the next 1-31 bytes (with some overlap)
+ ADD $-32, R9, R8
+ ADD $-32, R10, R4
+ // Fallthrough
+
+check17_32:
+ LXVD2X (R8+R0), V0
+ LXVD2X (R4+R0), V1
+ VCMPEQUBCC V0, V1, V2
+ ISEL $CR6LT, R11, R0, R5
+
+ // Load sX[len(sX)-16:len(sX)] and compare.
+ ADD $-16, R9
+ ADD $-16, R10
+ LXVD2X (R9+R0), V0
+ LXVD2X (R10+R0), V1
+ VCMPEQUBCC V0, V1, V2
+ ISEL $CR6LT, R5, R0, R3
+ RET
+
+check0_16:
+ CMP R5, $8
+ BLT check0_7
+ // Load sX[0:7] and compare.
+ MOVD (R8), R6
+ MOVD (R4), R7
+ CMP R6, R7
+ ISEL $CR0EQ, R11, R0, R5
+ // Load sX[len(sX)-8:len(sX)] and compare.
+ MOVD -8(R9), R6
+ MOVD -8(R10), R7
+ CMP R6, R7
+ ISEL $CR0EQ, R5, R0, R3
+ RET
+
+check0_7:
+ CMP R5,$0
+ MOVD $1, R3
+ BEQLR // return if len == 0
+
+ // Check < 8B loads with a single compare, but select the load address
+ // such that it cannot cross a page boundary. Load a few bytes from the
+ // lower address if that does not cross the lower page. Or, load a few
+ // extra bytes from the higher addresses. And align those values
+ // consistently in register as either address may have differing
+ // alignment requirements.
+ ANDCC $PAGE_OFFSET, R8, R6 // &sX & PAGE_OFFSET
+ ANDCC $PAGE_OFFSET, R4, R9
+ SUBC R5, $8, R12 // 8-len
+ SLD $3, R12, R14 // (8-len)*8
+ CMPU R6, R12, CR1 // Enough bytes lower in the page to load lower?
+ CMPU R9, R12, CR0
+ SUB R12, R8, R6 // compute lower load address
+ SUB R12, R4, R9
+ ISEL $CR1LT, R8, R6, R8 // R8 = R6 < 0 ? R8 (&s1) : R6 (&s1 - (8-len))
+ ISEL $CR0LT, R4, R9, R4 // Similar for s2
+ MOVD (R8), R15
+ MOVD (R4), R16
+ SLD R14, R15, R7
+ SLD R14, R16, R17
+ SRD R14, R7, R7 // Clear the upper (8-len) bytes (with 2 shifts)
+ SRD R14, R17, R17
+ SRD R14, R15, R6 // Clear the lower (8-len) bytes
+ SRD R14, R16, R9
+#ifdef GOARCH_ppc64le
+ ISEL $CR1LT, R7, R6, R8 // Choose the correct len bytes to compare based on alignment
+ ISEL $CR0LT, R17, R9, R4
+#else
+ ISEL $CR1LT, R6, R7, R8
+ ISEL $CR0LT, R9, R17, R4
+#endif
+ CMP R4, R8
+ ISEL $CR0EQ, R11, R0, R3
+ RET
diff --git a/src/internal/execabs/execabs.go b/src/internal/execabs/execabs.go
deleted file mode 100644
index 9a05d97..0000000
--- a/src/internal/execabs/execabs.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package execabs is a drop-in replacement for os/exec
-// that requires PATH lookups to find absolute paths.
-// That is, execabs.Command("cmd") runs the same PATH lookup
-// as exec.Command("cmd"), but if the result is a path
-// which is relative, the Run and Start methods will report
-// an error instead of running the executable.
-package execabs
-
-import (
- "context"
- "fmt"
- "os/exec"
- "path/filepath"
- "reflect"
- "unsafe"
-)
-
-var ErrNotFound = exec.ErrNotFound
-
-type (
- Cmd = exec.Cmd
- Error = exec.Error
- ExitError = exec.ExitError
-)
-
-func relError(file, path string) error {
- return fmt.Errorf("%s resolves to executable relative to current directory (.%c%s)", file, filepath.Separator, path)
-}
-
-func LookPath(file string) (string, error) {
- path, err := exec.LookPath(file)
- if err != nil {
- return "", err
- }
- if filepath.Base(file) == file && !filepath.IsAbs(path) {
- return "", relError(file, path)
- }
- return path, nil
-}
-
-func fixCmd(name string, cmd *exec.Cmd) {
- if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) {
- // exec.Command was called with a bare binary name and
- // exec.LookPath returned a path which is not absolute.
- // Set cmd.lookPathErr and clear cmd.Path so that it
- // cannot be run.
- lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer()))
- if *lookPathErr == nil {
- *lookPathErr = relError(name, cmd.Path)
- }
- cmd.Path = ""
- }
-}
-
-func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd {
- cmd := exec.CommandContext(ctx, name, arg...)
- fixCmd(name, cmd)
- return cmd
-
-}
-
-func Command(name string, arg ...string) *exec.Cmd {
- cmd := exec.Command(name, arg...)
- fixCmd(name, cmd)
- return cmd
-}
diff --git a/src/internal/execabs/execabs_test.go b/src/internal/execabs/execabs_test.go
deleted file mode 100644
index 97a3f39..0000000
--- a/src/internal/execabs/execabs_test.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package execabs
-
-import (
- "context"
- "fmt"
- "internal/testenv"
- "os"
- "os/exec"
- "path/filepath"
- "runtime"
- "testing"
-)
-
-func TestFixCmd(t *testing.T) {
- cmd := &exec.Cmd{Path: "hello"}
- fixCmd("hello", cmd)
- if cmd.Path != "" {
- t.Error("fixCmd didn't clear cmd.Path")
- }
- expectedErr := fmt.Sprintf("hello resolves to executable relative to current directory (.%chello)", filepath.Separator)
- if err := cmd.Run(); err == nil {
- t.Fatal("Command.Run didn't fail")
- } else if err.Error() != expectedErr {
- t.Fatalf("Command.Run returned unexpected error: want %q, got %q", expectedErr, err.Error())
- }
-}
-
-func TestCommand(t *testing.T) {
- testenv.MustHaveExec(t)
-
- for _, cmd := range []func(string) *Cmd{
- func(s string) *Cmd { return Command(s) },
- func(s string) *Cmd { return CommandContext(context.Background(), s) },
- } {
- tmpDir := t.TempDir()
- executable := "execabs-test"
- if runtime.GOOS == "windows" {
- executable += ".exe"
- }
- if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil {
- t.Fatalf("os.WriteFile failed: %s", err)
- }
- cwd, err := os.Getwd()
- if err != nil {
- t.Fatalf("os.Getwd failed: %s", err)
- }
- defer os.Chdir(cwd)
- if err = os.Chdir(tmpDir); err != nil {
- t.Fatalf("os.Chdir failed: %s", err)
- }
- if runtime.GOOS != "windows" {
- // add "." to PATH so that exec.LookPath looks in the current directory on
- // non-windows platforms as well
- origPath := os.Getenv("PATH")
- defer os.Setenv("PATH", origPath)
- os.Setenv("PATH", fmt.Sprintf(".:%s", origPath))
- }
- expectedErr := fmt.Sprintf("execabs-test resolves to executable relative to current directory (.%c%s)", filepath.Separator, executable)
- if err = cmd("execabs-test").Run(); err == nil {
- t.Fatalf("Command.Run didn't fail when exec.LookPath returned a relative path")
- } else if err.Error() != expectedErr {
- t.Errorf("Command.Run returned unexpected error: want %q, got %q", expectedErr, err.Error())
- }
- }
-}
-
-func TestLookPath(t *testing.T) {
- testenv.MustHaveExec(t)
-
- tmpDir := t.TempDir()
- executable := "execabs-test"
- if runtime.GOOS == "windows" {
- executable += ".exe"
- }
- if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0111); err != nil {
- t.Fatalf("os.WriteFile failed: %s", err)
- }
- cwd, err := os.Getwd()
- if err != nil {
- t.Fatalf("os.Getwd failed: %s", err)
- }
- defer os.Chdir(cwd)
- if err = os.Chdir(tmpDir); err != nil {
- t.Fatalf("os.Chdir failed: %s", err)
- }
- if runtime.GOOS != "windows" {
- // add "." to PATH so that exec.LookPath looks in the current directory on
- // non-windows platforms as well
- origPath := os.Getenv("PATH")
- defer os.Setenv("PATH", origPath)
- os.Setenv("PATH", fmt.Sprintf(".:%s", origPath))
- }
- expectedErr := fmt.Sprintf("execabs-test resolves to executable relative to current directory (.%c%s)", filepath.Separator, executable)
- if _, err := LookPath("execabs-test"); err == nil {
- t.Fatalf("LookPath didn't fail when finding a non-relative path")
- } else if err.Error() != expectedErr {
- t.Errorf("LookPath returned unexpected error: want %q, got %q", expectedErr, err.Error())
- }
-}
diff --git a/src/internal/goroot/gc.go b/src/internal/goroot/gc.go
index 8c66cd1..79403d2 100644
--- a/src/internal/goroot/gc.go
+++ b/src/internal/goroot/gc.go
@@ -7,8 +7,8 @@
package goroot
import (
- exec "internal/execabs"
"os"
+ "os/exec"
"path/filepath"
"strings"
"sync"
diff --git a/src/internal/poll/fd.go b/src/internal/poll/fd.go
index 69a9005..ef61d0c 100644
--- a/src/internal/poll/fd.go
+++ b/src/internal/poll/fd.go
@@ -74,6 +74,7 @@
return
}
n -= ln0
+ (*v)[0] = nil
*v = (*v)[1:]
}
}
diff --git a/src/math/big/alias_test.go b/src/math/big/alias_test.go
new file mode 100644
index 0000000..c0b947c
--- /dev/null
+++ b/src/math/big/alias_test.go
@@ -0,0 +1,312 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package big_test
+
+import (
+ cryptorand "crypto/rand"
+ "math/big"
+ "math/rand"
+ "reflect"
+ "testing"
+ "testing/quick"
+)
+
+func equal(z, x *big.Int) bool {
+ return z.Cmp(x) == 0
+}
+
+type bigInt struct {
+ *big.Int
+}
+
+func generatePositiveInt(rand *rand.Rand, size int) *big.Int {
+ n := big.NewInt(1)
+ n.Lsh(n, uint(rand.Intn(size*8)))
+ n.Rand(rand, n)
+ return n
+}
+
+func (bigInt) Generate(rand *rand.Rand, size int) reflect.Value {
+ n := generatePositiveInt(rand, size)
+ if rand.Intn(4) == 0 {
+ n.Neg(n)
+ }
+ return reflect.ValueOf(bigInt{n})
+}
+
+type notZeroInt struct {
+ *big.Int
+}
+
+func (notZeroInt) Generate(rand *rand.Rand, size int) reflect.Value {
+ n := generatePositiveInt(rand, size)
+ if rand.Intn(4) == 0 {
+ n.Neg(n)
+ }
+ if n.Sign() == 0 {
+ n.SetInt64(1)
+ }
+ return reflect.ValueOf(notZeroInt{n})
+}
+
+type positiveInt struct {
+ *big.Int
+}
+
+func (positiveInt) Generate(rand *rand.Rand, size int) reflect.Value {
+ n := generatePositiveInt(rand, size)
+ return reflect.ValueOf(positiveInt{n})
+}
+
+type prime struct {
+ *big.Int
+}
+
+func (prime) Generate(r *rand.Rand, size int) reflect.Value {
+ n, err := cryptorand.Prime(r, r.Intn(size*8-2)+2)
+ if err != nil {
+ panic(err)
+ }
+ return reflect.ValueOf(prime{n})
+}
+
+type zeroOrOne struct {
+ uint
+}
+
+func (zeroOrOne) Generate(rand *rand.Rand, size int) reflect.Value {
+ return reflect.ValueOf(zeroOrOne{uint(rand.Intn(2))})
+}
+
+type smallUint struct {
+ uint
+}
+
+func (smallUint) Generate(rand *rand.Rand, size int) reflect.Value {
+ return reflect.ValueOf(smallUint{uint(rand.Intn(1024))})
+}
+
+// checkAliasingOneArg checks if f returns a correct result when v and x alias.
+//
+// f is a function that takes x as an argument, doesn't modify it, sets v to the
+// result, and returns v. It is the function signature of unbound methods like
+//
+// func (v *big.Int) m(x *big.Int) *big.Int
+//
+// v and x are two random Int values. v is randomized even if it will be
+// overwritten to test for improper buffer reuse.
+func checkAliasingOneArg(t *testing.T, f func(v, x *big.Int) *big.Int, v, x *big.Int) bool {
+ x1, v1 := new(big.Int).Set(x), new(big.Int).Set(x)
+
+ // Calculate a reference f(x) without aliasing.
+ if out := f(v, x); out != v {
+ return false
+ }
+
+ // Test aliasing the argument and the receiver.
+ if out := f(v1, v1); out != v1 || !equal(v1, v) {
+ t.Logf("f(v, x) != f(x, x)")
+ return false
+ }
+
+ // Ensure the arguments was not modified.
+ return equal(x, x1)
+}
+
+// checkAliasingTwoArgs checks if f returns a correct result when any
+// combination of v, x and y alias.
+//
+// f is a function that takes x and y as arguments, doesn't modify them, sets v
+// to the result, and returns v. It is the function signature of unbound methods
+// like
+//
+// func (v *big.Int) m(x, y *big.Int) *big.Int
+//
+// v, x and y are random Int values. v is randomized even if it will be
+// overwritten to test for improper buffer reuse.
+func checkAliasingTwoArgs(t *testing.T, f func(v, x, y *big.Int) *big.Int, v, x, y *big.Int) bool {
+ x1, y1, v1 := new(big.Int).Set(x), new(big.Int).Set(y), new(big.Int).Set(v)
+
+ // Calculate a reference f(x, y) without aliasing.
+ if out := f(v, x, y); out == nil {
+ // Certain functions like ModInverse return nil for certain inputs.
+ // Check that receiver and arguments were unchanged and move on.
+ return equal(x, x1) && equal(y, y1) && equal(v, v1)
+ } else if out != v {
+ return false
+ }
+
+ // Test aliasing the first argument and the receiver.
+ v1.Set(x)
+ if out := f(v1, v1, y); out != v1 || !equal(v1, v) {
+ t.Logf("f(v, x, y) != f(x, x, y)")
+ return false
+ }
+ // Test aliasing the second argument and the receiver.
+ v1.Set(y)
+ if out := f(v1, x, v1); out != v1 || !equal(v1, v) {
+ t.Logf("f(v, x, y) != f(y, x, y)")
+ return false
+ }
+
+ // Calculate a reference f(y, y) without aliasing.
+ // We use y because it's the one that commonly has restrictions
+ // like being prime or non-zero.
+ v1.Set(v)
+ y2 := new(big.Int).Set(y)
+ if out := f(v, y, y2); out == nil {
+ return equal(y, y1) && equal(y2, y1) && equal(v, v1)
+ } else if out != v {
+ return false
+ }
+
+ // Test aliasing the two arguments.
+ if out := f(v1, y, y); out != v1 || !equal(v1, v) {
+ t.Logf("f(v, y1, y2) != f(v, y, y)")
+ return false
+ }
+ // Test aliasing the two arguments and the receiver.
+ v1.Set(y)
+ if out := f(v1, v1, v1); out != v1 || !equal(v1, v) {
+ t.Logf("f(v, y1, y2) != f(y, y, y)")
+ return false
+ }
+
+ // Ensure the arguments were not modified.
+ return equal(x, x1) && equal(y, y1)
+}
+
+func TestAliasing(t *testing.T) {
+ for name, f := range map[string]interface{}{
+ "Abs": func(v, x bigInt) bool {
+ return checkAliasingOneArg(t, (*big.Int).Abs, v.Int, x.Int)
+ },
+ "Add": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Add, v.Int, x.Int, y.Int)
+ },
+ "And": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).And, v.Int, x.Int, y.Int)
+ },
+ "AndNot": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).AndNot, v.Int, x.Int, y.Int)
+ },
+ "Div": func(v, x bigInt, y notZeroInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Div, v.Int, x.Int, y.Int)
+ },
+ "Exp-XY": func(v, x, y bigInt, z notZeroInt) bool {
+ return checkAliasingTwoArgs(t, func(v, x, y *big.Int) *big.Int {
+ return v.Exp(x, y, z.Int)
+ }, v.Int, x.Int, y.Int)
+ },
+ "Exp-XZ": func(v, x, y bigInt, z notZeroInt) bool {
+ return checkAliasingTwoArgs(t, func(v, x, z *big.Int) *big.Int {
+ return v.Exp(x, y.Int, z)
+ }, v.Int, x.Int, z.Int)
+ },
+ "Exp-YZ": func(v, x, y bigInt, z notZeroInt) bool {
+ return checkAliasingTwoArgs(t, func(v, y, z *big.Int) *big.Int {
+ return v.Exp(x.Int, y, z)
+ }, v.Int, y.Int, z.Int)
+ },
+ "GCD": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, func(v, x, y *big.Int) *big.Int {
+ return v.GCD(nil, nil, x, y)
+ }, v.Int, x.Int, y.Int)
+ },
+ "GCD-X": func(v, x, y bigInt) bool {
+ a, b := new(big.Int), new(big.Int)
+ return checkAliasingTwoArgs(t, func(v, x, y *big.Int) *big.Int {
+ a.GCD(v, b, x, y)
+ return v
+ }, v.Int, x.Int, y.Int)
+ },
+ "GCD-Y": func(v, x, y bigInt) bool {
+ a, b := new(big.Int), new(big.Int)
+ return checkAliasingTwoArgs(t, func(v, x, y *big.Int) *big.Int {
+ a.GCD(b, v, x, y)
+ return v
+ }, v.Int, x.Int, y.Int)
+ },
+ "Lsh": func(v, x bigInt, n smallUint) bool {
+ return checkAliasingOneArg(t, func(v, x *big.Int) *big.Int {
+ return v.Lsh(x, n.uint)
+ }, v.Int, x.Int)
+ },
+ "Mod": func(v, x bigInt, y notZeroInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Mod, v.Int, x.Int, y.Int)
+ },
+ "ModInverse": func(v, x bigInt, y notZeroInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).ModInverse, v.Int, x.Int, y.Int)
+ },
+ "ModSqrt": func(v, x bigInt, p prime) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).ModSqrt, v.Int, x.Int, p.Int)
+ },
+ "Mul": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Mul, v.Int, x.Int, y.Int)
+ },
+ "Neg": func(v, x bigInt) bool {
+ return checkAliasingOneArg(t, (*big.Int).Neg, v.Int, x.Int)
+ },
+ "Not": func(v, x bigInt) bool {
+ return checkAliasingOneArg(t, (*big.Int).Not, v.Int, x.Int)
+ },
+ "Or": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Or, v.Int, x.Int, y.Int)
+ },
+ "Quo": func(v, x bigInt, y notZeroInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Quo, v.Int, x.Int, y.Int)
+ },
+ "Rand": func(v, x bigInt, seed int64) bool {
+ return checkAliasingOneArg(t, func(v, x *big.Int) *big.Int {
+ rnd := rand.New(rand.NewSource(seed))
+ return v.Rand(rnd, x)
+ }, v.Int, x.Int)
+ },
+ "Rem": func(v, x bigInt, y notZeroInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Rem, v.Int, x.Int, y.Int)
+ },
+ "Rsh": func(v, x bigInt, n smallUint) bool {
+ return checkAliasingOneArg(t, func(v, x *big.Int) *big.Int {
+ return v.Rsh(x, n.uint)
+ }, v.Int, x.Int)
+ },
+ "Set": func(v, x bigInt) bool {
+ return checkAliasingOneArg(t, (*big.Int).Set, v.Int, x.Int)
+ },
+ "SetBit": func(v, x bigInt, i smallUint, b zeroOrOne) bool {
+ return checkAliasingOneArg(t, func(v, x *big.Int) *big.Int {
+ return v.SetBit(x, int(i.uint), b.uint)
+ }, v.Int, x.Int)
+ },
+ "Sqrt": func(v bigInt, x positiveInt) bool {
+ return checkAliasingOneArg(t, (*big.Int).Sqrt, v.Int, x.Int)
+ },
+ "Sub": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Sub, v.Int, x.Int, y.Int)
+ },
+ "Xor": func(v, x, y bigInt) bool {
+ return checkAliasingTwoArgs(t, (*big.Int).Xor, v.Int, x.Int, y.Int)
+ },
+ } {
+ t.Run(name, func(t *testing.T) {
+ scale := 1.0
+ switch name {
+ case "ModInverse", "GCD-Y", "GCD-X":
+ scale /= 5
+ case "Rand":
+ scale /= 10
+ case "Exp-XZ", "Exp-XY", "Exp-YZ":
+ scale /= 50
+ case "ModSqrt":
+ scale /= 500
+ }
+ if err := quick.Check(f, &quick.Config{
+ MaxCountScale: scale,
+ }); err != nil {
+ t.Error(err)
+ }
+ })
+ }
+}
diff --git a/src/math/big/arith.go b/src/math/big/arith.go
index 8f55c19..06e63e25 100644
--- a/src/math/big/arith.go
+++ b/src/math/big/arith.go
@@ -41,7 +41,7 @@
// These operations are used by the vector operations below.
// z1<<_W + z0 = x*y
-func mulWW_g(x, y Word) (z1, z0 Word) {
+func mulWW(x, y Word) (z1, z0 Word) {
hi, lo := bits.Mul(uint(x), uint(y))
return Word(hi), Word(lo)
}
diff --git a/src/math/big/arith_386.s b/src/math/big/arith_386.s
index acf2b06..8cf4665 100644
--- a/src/math/big/arith_386.s
+++ b/src/math/big/arith_386.s
@@ -10,15 +10,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB),NOSPLIT,$0
- MOVL x+0(FP), AX
- MULL y+4(FP)
- MOVL DX, z1+8(FP)
- MOVL AX, z0+12(FP)
- RET
-
-
// func addVV(z, x, y []Word) (c Word)
TEXT ·addVV(SB),NOSPLIT,$0
MOVL z+0(FP), DI
diff --git a/src/math/big/arith_amd64.s b/src/math/big/arith_amd64.s
index 5c72a27..b1e914c 100644
--- a/src/math/big/arith_amd64.s
+++ b/src/math/big/arith_amd64.s
@@ -10,16 +10,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB),NOSPLIT,$0
- MOVQ x+0(FP), AX
- MULQ y+8(FP)
- MOVQ DX, z1+16(FP)
- MOVQ AX, z0+24(FP)
- RET
-
-
-
// The carry bit is saved with SBBQ Rx, Rx: if the carry was set, Rx is -1, otherwise it is 0.
// It is restored with ADDQ Rx, Rx: if Rx was -1 the carry is set, otherwise it is cleared.
// This is faster than using rotate instructions.
diff --git a/src/math/big/arith_arm.s b/src/math/big/arith_arm.s
index f2872d8..10054bd 100644
--- a/src/math/big/arith_arm.s
+++ b/src/math/big/arith_arm.s
@@ -271,14 +271,3 @@
MOVW R4, c+28(FP)
RET
-
-
-
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB),NOSPLIT,$0
- MOVW x+0(FP), R1
- MOVW y+4(FP), R2
- MULLU R1, R2, (R4, R3)
- MOVW R4, z1+8(FP)
- MOVW R3, z0+12(FP)
- RET
diff --git a/src/math/big/arith_arm64.s b/src/math/big/arith_arm64.s
index 7bfe08e..addf2d6 100644
--- a/src/math/big/arith_arm64.s
+++ b/src/math/big/arith_arm64.s
@@ -13,17 +13,6 @@
// TODO: Consider re-implementing using Advanced SIMD
// once the assembler supports those instructions.
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB),NOSPLIT,$0
- MOVD x+0(FP), R0
- MOVD y+8(FP), R1
- MUL R0, R1, R2
- UMULH R0, R1, R3
- MOVD R3, z1+16(FP)
- MOVD R2, z0+24(FP)
- RET
-
-
// func addVV(z, x, y []Word) (c Word)
TEXT ·addVV(SB),NOSPLIT,$0
MOVD z_len+8(FP), R0
diff --git a/src/math/big/arith_decl.go b/src/math/big/arith_decl.go
index eea3d6b..301aa55 100644
--- a/src/math/big/arith_decl.go
+++ b/src/math/big/arith_decl.go
@@ -8,7 +8,6 @@
package big
// implemented in arith_$GOARCH.s
-func mulWW(x, y Word) (z1, z0 Word)
func addVV(z, x, y []Word) (c Word)
func subVV(z, x, y []Word) (c Word)
func addVW(z, x []Word, y Word) (c Word)
diff --git a/src/math/big/arith_decl_pure.go b/src/math/big/arith_decl_pure.go
index 059f6f1..75f3ed2 100644
--- a/src/math/big/arith_decl_pure.go
+++ b/src/math/big/arith_decl_pure.go
@@ -7,10 +7,6 @@
package big
-func mulWW(x, y Word) (z1, z0 Word) {
- return mulWW_g(x, y)
-}
-
func addVV(z, x, y []Word) (c Word) {
return addVV_g(z, x, y)
}
diff --git a/src/math/big/arith_mips64x.s b/src/math/big/arith_mips64x.s
index 4b5c502..3ee6e27 100644
--- a/src/math/big/arith_mips64x.s
+++ b/src/math/big/arith_mips64x.s
@@ -11,9 +11,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-TEXT ·mulWW(SB),NOSPLIT,$0
- JMP ·mulWW_g(SB)
-
TEXT ·addVV(SB),NOSPLIT,$0
JMP ·addVV_g(SB)
diff --git a/src/math/big/arith_mipsx.s b/src/math/big/arith_mipsx.s
index e72e6d6..b1d3282 100644
--- a/src/math/big/arith_mipsx.s
+++ b/src/math/big/arith_mipsx.s
@@ -11,9 +11,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-TEXT ·mulWW(SB),NOSPLIT,$0
- JMP ·mulWW_g(SB)
-
TEXT ·addVV(SB),NOSPLIT,$0
JMP ·addVV_g(SB)
diff --git a/src/math/big/arith_ppc64x.s b/src/math/big/arith_ppc64x.s
index 601cafe..a83696a 100644
--- a/src/math/big/arith_ppc64x.s
+++ b/src/math/big/arith_ppc64x.s
@@ -11,16 +11,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB), NOSPLIT, $0
- MOVD x+0(FP), R4
- MOVD y+8(FP), R5
- MULHDU R4, R5, R6
- MULLD R4, R5, R7
- MOVD R6, z1+16(FP)
- MOVD R7, z0+24(FP)
- RET
-
// func addVV(z, y, y []Word) (c Word)
// z[i] = x[i] + y[i] for all i, carrying
TEXT ·addVV(SB), NOSPLIT, $0
diff --git a/src/math/big/arith_riscv64.s b/src/math/big/arith_riscv64.s
index 2e950dd..cb9ac18 100644
--- a/src/math/big/arith_riscv64.s
+++ b/src/math/big/arith_riscv64.s
@@ -10,17 +10,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-// func mulWW(x, y Word) (z1, z0 Word)
-TEXT ·mulWW(SB),NOSPLIT,$0
- MOV x+0(FP), X5
- MOV y+8(FP), X6
- MULHU X5, X6, X7
- MUL X5, X6, X8
- MOV X7, z1+16(FP)
- MOV X8, z0+24(FP)
- RET
-
-
TEXT ·addVV(SB),NOSPLIT,$0
JMP ·addVV_g(SB)
diff --git a/src/math/big/arith_s390x.s b/src/math/big/arith_s390x.s
index ad822f7..aa6590e 100644
--- a/src/math/big/arith_s390x.s
+++ b/src/math/big/arith_s390x.s
@@ -10,15 +10,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-TEXT ·mulWW(SB), NOSPLIT, $0
- MOVD x+0(FP), R3
- MOVD y+8(FP), R4
- MULHDU R3, R4
- MOVD R10, z1+16(FP)
- MOVD R11, z0+24(FP)
- RET
-
-
// DI = R3, CX = R4, SI = r10, r8 = r8, r9=r9, r10 = r2, r11 = r5, r12 = r6, r13 = r7, r14 = r1 (R0 set to 0) + use R11
// func addVV(z, x, y []Word) (c Word)
diff --git a/src/math/big/arith_test.go b/src/math/big/arith_test.go
index 789b96b..e530dd9 100644
--- a/src/math/big/arith_test.go
+++ b/src/math/big/arith_test.go
@@ -558,7 +558,7 @@
func TestMulWW(t *testing.T) {
for i, test := range mulWWTests {
- q, r := mulWW_g(test.x, test.y)
+ q, r := mulWW(test.x, test.y)
if q != test.q || r != test.r {
t.Errorf("#%d got (%x, %x) want (%x, %x)", i, q, r, test.q, test.r)
}
diff --git a/src/math/big/arith_wasm.s b/src/math/big/arith_wasm.s
index e8605f1..93eb16d 100644
--- a/src/math/big/arith_wasm.s
+++ b/src/math/big/arith_wasm.s
@@ -7,9 +7,6 @@
#include "textflag.h"
-TEXT ·mulWW(SB),NOSPLIT,$0
- JMP ·mulWW_g(SB)
-
TEXT ·addVV(SB),NOSPLIT,$0
JMP ·addVV_g(SB)
diff --git a/src/math/big/int.go b/src/math/big/int.go
index a31cf27..01ff0bf 100644
--- a/src/math/big/int.go
+++ b/src/math/big/int.go
@@ -497,6 +497,9 @@
var mWords nat
if m != nil {
+ if z == m || alias(z.abs, m.abs) {
+ m = new(Int).Set(m)
+ }
mWords = m.abs // m.abs may be nil for m == 0
}
@@ -790,11 +793,13 @@
// As this uses the math/rand package, it must not be used for
// security-sensitive work. Use crypto/rand.Int instead.
func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int {
- z.neg = false
+ // z.neg is not modified before the if check, because z and n might alias.
if n.neg || len(n.abs) == 0 {
+ z.neg = false
z.abs = nil
return z
}
+ z.neg = false
z.abs = z.abs.random(rnd, n.abs, n.abs.bitLen())
return z
}
@@ -802,7 +807,7 @@
// ModInverse sets z to the multiplicative inverse of g in the ring ℤ/nℤ
// and returns z. If g and n are not relatively prime, g has no multiplicative
// inverse in the ring ℤ/nℤ. In this case, z is unchanged and the return value
-// is nil.
+// is nil. If n == 0, a division-by-zero run-time panic occurs.
func (z *Int) ModInverse(g, n *Int) *Int {
// GCD expects parameters a and b to be > 0.
if n.neg {
@@ -979,7 +984,7 @@
// ModSqrt sets z to a square root of x mod p if such a square root exists, and
// returns z. The modulus p must be an odd prime. If x is not a square mod p,
// ModSqrt leaves z unchanged and returns nil. This function panics if p is
-// not an odd integer.
+// not an odd integer, its behavior is undefined if p is odd but not prime.
func (z *Int) ModSqrt(x, p *Int) *Int {
switch Jacobi(x, p) {
case -1:
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 4a76e6a..0b60015 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -30,7 +30,6 @@
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"math"
mathrand "math/rand"
@@ -1294,7 +1293,7 @@
type http2headerFieldValueError string
func (e http2headerFieldValueError) Error() string {
- return fmt.Sprintf("invalid header field value %q", string(e))
+ return fmt.Sprintf("invalid header field value for %q", string(e))
}
var (
@@ -2864,7 +2863,8 @@
fr.debugReadLoggerf("http2: decoded hpack field %+v", hf)
}
if !httpguts.ValidHeaderFieldValue(hf.Value) {
- invalid = http2headerFieldValueError(hf.Value)
+ // Don't include the value in the error, because it may be sensitive.
+ invalid = http2headerFieldValueError(hf.Name)
}
isPseudo := strings.HasPrefix(hf.Name, ":")
if isPseudo {
@@ -3583,8 +3583,8 @@
// validPseudoPath reports whether v is a valid :path pseudo-header
// value. It must be either:
//
-// *) a non-empty string starting with '/'
-// *) the string '*', for OPTIONS requests.
+// - a non-empty string starting with '/'
+// - the string '*', for OPTIONS requests.
//
// For now this is only used a quick check for deciding when to clean
// up Opaque URLs before sending requests from the Transport.
@@ -4119,7 +4119,7 @@
if s.NewWriteScheduler != nil {
sc.writeSched = s.NewWriteScheduler()
} else {
- sc.writeSched = http2NewRandomWriteScheduler()
+ sc.writeSched = http2NewPriorityWriteScheduler(nil)
}
// These start at the RFC-specified defaults. If there is a higher
@@ -6040,17 +6040,18 @@
_ http2incomparable
stream *http2stream
conn *http2serverConn
- closed bool // for use by Close only
+ closeOnce sync.Once // for use by Close only
sawEOF bool // for use by Read only
pipe *http2pipe // non-nil if we have a HTTP entity message body
needsContinue bool // need to send a 100-continue
}
func (b *http2requestBody) Close() error {
- if b.pipe != nil && !b.closed {
- b.pipe.BreakWithError(http2errClosedBody)
- }
- b.closed = true
+ b.closeOnce.Do(func() {
+ if b.pipe != nil {
+ b.pipe.BreakWithError(http2errClosedBody)
+ }
+ })
return nil
}
@@ -7221,12 +7222,14 @@
if req, err = http2shouldRetryRequest(req, err); err == nil {
// After the first retry, do exponential backoff with 10% jitter.
if retry == 0 {
+ t.vlogf("RoundTrip retrying after failure: %v", err)
continue
}
backoff := float64(uint(1) << (uint(retry) - 1))
backoff += backoff * (0.1 * mathrand.Float64())
select {
case <-time.After(time.Second * time.Duration(backoff)):
+ t.vlogf("RoundTrip retrying after failure: %v", err)
continue
case <-req.Context().Done():
err = req.Context().Err()
@@ -7452,10 +7455,13 @@
// trigger the healthCheck again if there is no frame received.
ctx, cancel := context.WithTimeout(context.Background(), pingTimeout)
defer cancel()
+ cc.vlogf("http2: Transport sending health check")
err := cc.Ping(ctx)
if err != nil {
+ cc.vlogf("http2: Transport health check failure: %v", err)
cc.closeForLostPing()
- return
+ } else {
+ cc.vlogf("http2: Transport health check success")
}
}
@@ -8485,7 +8491,8 @@
}
for _, v := range vv {
if !httpguts.ValidHeaderFieldValue(v) {
- return nil, fmt.Errorf("invalid HTTP header value %q for header %q", v, k)
+ // Don't include the value in the error, because it may be sensitive.
+ return nil, fmt.Errorf("invalid HTTP header value for header %q", k)
}
}
}
@@ -9618,7 +9625,13 @@
log.Printf(format, args...)
}
-var http2noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil))
+var http2noBody io.ReadCloser = http2noBodyReader{}
+
+type http2noBodyReader struct{}
+
+func (http2noBodyReader) Close() error { return nil }
+
+func (http2noBodyReader) Read([]byte) (int, error) { return 0, io.EOF }
type http2missingBody struct{}
diff --git a/src/net/url/url.go b/src/net/url/url.go
index 58b3041..db4d638 100644
--- a/src/net/url/url.go
+++ b/src/net/url/url.go
@@ -428,7 +428,7 @@
}
// Maybe rawURL is of the form scheme:path.
-// (Scheme must be [a-zA-Z][a-zA-Z0-9+-.]*)
+// (Scheme must be [a-zA-Z][a-zA-Z0-9+.-]*)
// If so, return scheme, path; else return "", rawURL.
func getScheme(rawURL string) (scheme, path string, err error) {
for i := 0; i < len(rawURL); i++ {
diff --git a/src/os/exec/dot_test.go b/src/os/exec/dot_test.go
new file mode 100644
index 0000000..932d907
--- /dev/null
+++ b/src/os/exec/dot_test.go
@@ -0,0 +1,87 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package exec_test
+
+import (
+ "errors"
+ "internal/testenv"
+ "os"
+ . "os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "testing"
+)
+
+func TestLookPath(t *testing.T) {
+ testenv.MustHaveExec(t)
+
+ tmpDir := filepath.Join(t.TempDir(), "testdir")
+ if err := os.Mkdir(tmpDir, 0777); err != nil {
+ t.Fatal(err)
+ }
+
+ executable := "execabs-test"
+ if runtime.GOOS == "windows" {
+ executable += ".exe"
+ }
+ if err := os.WriteFile(filepath.Join(tmpDir, executable), []byte{1, 2, 3}, 0777); err != nil {
+ t.Fatal(err)
+ }
+ cwd, err := os.Getwd()
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer func() {
+ if err := os.Chdir(cwd); err != nil {
+ panic(err)
+ }
+ }()
+ if err = os.Chdir(tmpDir); err != nil {
+ t.Fatal(err)
+ }
+ origPath := os.Getenv("PATH")
+ defer os.Setenv("PATH", origPath)
+
+ // Add "." to PATH so that exec.LookPath looks in the current directory on all systems.
+ // And try to trick it with "../testdir" too.
+ for _, dir := range []string{".", "../testdir"} {
+ os.Setenv("PATH", dir+string(filepath.ListSeparator)+origPath)
+ t.Run("PATH="+dir, func(t *testing.T) {
+ good := dir + "/execabs-test"
+ if found, err := LookPath(good); err != nil || !strings.HasPrefix(found, good) {
+ t.Fatalf("LookPath(%q) = %q, %v, want \"%s...\", nil", good, found, err, good)
+ }
+ if runtime.GOOS == "windows" {
+ good = dir + `\execabs-test`
+ if found, err := LookPath(good); err != nil || !strings.HasPrefix(found, good) {
+ t.Fatalf("LookPath(%q) = %q, %v, want \"%s...\", nil", good, found, err, good)
+ }
+ }
+
+ if _, err := LookPath("execabs-test"); err == nil {
+ t.Fatalf("LookPath didn't fail when finding a non-relative path")
+ } else if !errors.Is(err, ErrDot) {
+ t.Fatalf("LookPath returned unexpected error: want Is ErrDot, got %q", err)
+ }
+
+ cmd := Command("execabs-test")
+ if cmd.Err == nil {
+ t.Fatalf("Command didn't fail when finding a non-relative path")
+ } else if !errors.Is(cmd.Err, ErrDot) {
+ t.Fatalf("Command returned unexpected error: want Is ErrDot, got %q", cmd.Err)
+ }
+ cmd.Err = nil
+
+ // Clearing cmd.Err should let the execution proceed,
+ // and it should fail because it's not a valid binary.
+ if err := cmd.Run(); err == nil {
+ t.Fatalf("Run did not fail: expected exec error")
+ } else if errors.Is(err, ErrDot) {
+ t.Fatalf("Run returned unexpected error ErrDot: want error like ENOEXEC: %q", err)
+ }
+ })
+ }
+}
diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go
index 91c2e00..dad63f1 100644
--- a/src/os/exec/exec.go
+++ b/src/os/exec/exec.go
@@ -18,6 +18,71 @@
// Note that the examples in this package assume a Unix system.
// They may not run on Windows, and they do not run in the Go Playground
// used by golang.org and godoc.org.
+//
+// Executables in the current directory
+//
+// The functions Command and LookPath look for a program
+// in the directories listed in the current path, following the
+// conventions of the host operating system.
+// Operating systems have for decades included the current
+// directory in this search, sometimes implicitly and sometimes
+// configured explicitly that way by default.
+// Modern practice is that including the current directory
+// is usually unexpected and often leads to security problems.
+//
+// To avoid those security problems, as of Go 1.19, this package will not resolve a program
+// using an implicit or explicit path entry relative to the current directory.
+// That is, if you run exec.LookPath("go"), it will not successfully return
+// ./go on Unix nor .\go.exe on Windows, no matter how the path is configured.
+// Instead, if the usual path algorithms would result in that answer,
+// these functions return an error err satisfying errors.Is(err, ErrDot).
+//
+// For example, consider these two program snippets:
+//
+// path, err := exec.LookPath("prog")
+// if err != nil {
+// log.Fatal(err)
+// }
+// use(path)
+//
+// and
+//
+// cmd := exec.Command("prog")
+// if err := cmd.Run(); err != nil {
+// log.Fatal(err)
+// }
+//
+// These will not find and run ./prog or .\prog.exe,
+// no matter how the current path is configured.
+//
+// Code that always wants to run a program from the current directory
+// can be rewritten to say "./prog" instead of "prog".
+//
+// Code that insists on including results from relative path entries
+// can instead override the error using an errors.Is check:
+//
+// path, err := exec.LookPath("prog")
+// if errors.Is(err, exec.ErrDot) {
+// err = nil
+// }
+// if err != nil {
+// log.Fatal(err)
+// }
+// use(path)
+//
+// and
+//
+// cmd := exec.Command("prog")
+// if errors.Is(cmd.Err, exec.ErrDot) {
+// cmd.Err = nil
+// }
+// if err := cmd.Run(); err != nil {
+// log.Fatal(err)
+// }
+//
+// Before adding such overrides, make sure you understand the
+// security implications of doing so.
+// See https://go.dev/blog/path-security for more information.
package exec
import (
@@ -134,7 +199,7 @@
ProcessState *os.ProcessState
ctx context.Context // nil means none
- lookPathErr error // LookPath error, if any.
+ Err error // LookPath error, if any.
finished bool // when Wait was called
childFiles []*os.File
closeAfterStart []io.Closer
@@ -142,6 +207,25 @@
goroutine []func() error
errch chan error // one send per goroutine
waitDone chan struct{}
+
+ // For a security release long ago, we created x/sys/execabs,
+ // which manipulated the unexported lookPathErr error field
+ // in this struct. For Go 1.19 we exported the field as Err error,
+ // above, but we have to keep lookPathErr around for use by
+ // old programs building against new toolchains.
+ // The String and Start methods look for an error in lookPathErr
+ // in preference to Err, to preserve the errors that execabs sets.
+ //
+ // In general we don't guarantee misuse of reflect like this,
+ // but the misuse of reflect was by us, the best of various bad
+ // options to fix the security problem, and people depend on
+ // those old copies of execabs continuing to work.
+ // The result is that we have to leave this variable around for the
+ // rest of time, a compatibility scar.
+ //
+ // See https://go.dev/blog/path-security
+ // and https://go.dev/issue/43724 for more context.
+ lookPathErr error
}
// Command returns the Cmd struct to execute the named program with
@@ -173,7 +257,7 @@
}
if filepath.Base(name) == name {
if lp, err := LookPath(name); err != nil {
- cmd.lookPathErr = err
+ cmd.Err = err
} else {
cmd.Path = lp
}
@@ -200,7 +284,7 @@
// In particular, it is not suitable for use as input to a shell.
// The output of String may vary across Go releases.
func (c *Cmd) String() string {
- if c.lookPathErr != nil {
+ if c.Err != nil || c.lookPathErr != nil {
// failed to resolve path; report the original requested path (plus args)
return strings.Join(c.Args, " ")
}
@@ -335,7 +419,7 @@
// lookExtensions does not search PATH, instead it converts `prog` into `.\prog`.
func lookExtensions(path, dir string) (string, error) {
if filepath.Base(path) == path {
- path = filepath.Join(".", path)
+ path = "." + string(filepath.Separator) + path
}
if dir == "" {
return LookPath(path)
@@ -363,10 +447,13 @@
// The Wait method will return the exit code and release associated resources
// once the command exits.
func (c *Cmd) Start() error {
- if c.lookPathErr != nil {
+ if c.Err != nil || c.lookPathErr != nil {
c.closeDescriptors(c.closeAfterStart)
c.closeDescriptors(c.closeAfterWait)
- return c.lookPathErr
+ if c.lookPathErr != nil {
+ return c.lookPathErr
+ }
+ return c.Err
}
if runtime.GOOS == "windows" {
lp, err := lookExtensions(c.Path, c.Dir)
@@ -845,3 +932,12 @@
}
return append(env, "SYSTEMROOT="+os.Getenv("SYSTEMROOT"))
}
+
+// ErrDot indicates that a path lookup resolved to an executable
+// in the current directory due to ‘.’ being in the path, either
+// implicitly or explicitly. See the package documentation for details.
+//
+// Note that functions in this package do not return ErrDot directly.
+// Code should use errors.Is(err, ErrDot), not err == ErrDot,
+// to test whether a returned error err is due to this condition.
+var ErrDot = errors.New("cannot run executable found relative to current directory")
diff --git a/src/os/exec/lp_plan9.go b/src/os/exec/lp_plan9.go
index e8826a5..6822481 100644
--- a/src/os/exec/lp_plan9.go
+++ b/src/os/exec/lp_plan9.go
@@ -30,7 +30,11 @@
// directories named by the path environment variable.
// If file begins with "/", "#", "./", or "../", it is tried
// directly and the path is not consulted.
-// The result may be an absolute path or a path relative to the current directory.
+// On success, the result is an absolute path.
+//
+// In older versions of Go, LookPath could return a path relative to the current directory.
+// As of Go 1.19, LookPath will instead return that path along with an error satisfying
+// errors.Is(err, ErrDot). See the package documentation for more details.
func LookPath(file string) (string, error) {
// skip the path lookup for these prefixes
skip := []string{"/", "#", "./", "../"}
@@ -49,6 +53,9 @@
for _, dir := range filepath.SplitList(path) {
path := filepath.Join(dir, file)
if err := findExecutable(path); err == nil {
+ if !filepath.IsAbs(path) {
+ return path, &Error{file, ErrDot}
+ }
return path, nil
}
}
diff --git a/src/os/exec/lp_unix.go b/src/os/exec/lp_unix.go
index 5db6c5e..9833205 100644
--- a/src/os/exec/lp_unix.go
+++ b/src/os/exec/lp_unix.go
@@ -31,7 +31,11 @@
// LookPath searches for an executable named file in the
// directories named by the PATH environment variable.
// If file contains a slash, it is tried directly and the PATH is not consulted.
-// The result may be an absolute path or a path relative to the current directory.
+// Otherwise, on success, the result is an absolute path.
+//
+// In older versions of Go, LookPath could return a path relative to the current directory.
+// As of Go 1.19, LookPath will instead return that path along with an error satisfying
+// errors.Is(err, ErrDot). See the package documentation for more details.
func LookPath(file string) (string, error) {
// NOTE(rsc): I wish we could use the Plan 9 behavior here
// (only bypass the path if file begins with / or ./ or ../)
@@ -52,6 +56,9 @@
}
path := filepath.Join(dir, file)
if err := findExecutable(path); err == nil {
+ if !filepath.IsAbs(path) {
+ return path, &Error{file, ErrDot}
+ }
return path, nil
}
}
diff --git a/src/os/exec/lp_windows.go b/src/os/exec/lp_windows.go
index e7a2cdf..dab5770 100644
--- a/src/os/exec/lp_windows.go
+++ b/src/os/exec/lp_windows.go
@@ -10,6 +10,7 @@
"os"
"path/filepath"
"strings"
+ "syscall"
)
// ErrNotFound is the error resulting if a path search failed to find an executable file.
@@ -53,10 +54,14 @@
// LookPath searches for an executable named file in the
// directories named by the PATH environment variable.
-// If file contains a slash, it is tried directly and the PATH is not consulted.
// LookPath also uses PATHEXT environment variable to match
// a suitable candidate.
-// The result may be an absolute path or a path relative to the current directory.
+// If file contains a slash, it is tried directly and the PATH is not consulted.
+// Otherwise, on success, the result is an absolute path.
+//
+// In older versions of Go, LookPath could return a path relative to the current directory.
+// As of Go 1.19, LookPath will instead return that path along with an error satisfying
+// errors.Is(err, ErrDot). See the package documentation for more details.
func LookPath(file string) (string, error) {
var exts []string
x := os.Getenv(`PATHEXT`)
@@ -75,18 +80,34 @@
}
if strings.ContainsAny(file, `:\/`) {
- if f, err := findExecutable(file, exts); err == nil {
+ f, err := findExecutable(file, exts)
+ if err == nil {
return f, nil
- } else {
- return "", &Error{file, err}
+ }
+ return "", &Error{file, err}
+ }
+
+ // On Windows, creating the NoDefaultCurrentDirectoryInExePath
+ // environment variable (with any value or no value!) signals that
+ // path lookups should skip the current directory.
+ // In theory we are supposed to call NeedCurrentDirectoryForExePathW
+ // "as the registry location of this environment variable can change"
+ // but that seems exceedingly unlikely: it would break all users who
+ // have configured their environment this way!
+ // https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-needcurrentdirectoryforexepathw
+ // See also go.dev/issue/43947.
+ if _, found := syscall.Getenv("NoDefaultCurrentDirectoryInExePath"); !found {
+ if f, err := findExecutable(filepath.Join(".", file), exts); err == nil {
+ return f, &Error{file, ErrDot}
}
}
- if f, err := findExecutable(filepath.Join(".", file), exts); err == nil {
- return f, nil
- }
+
path := os.Getenv("path")
for _, dir := range filepath.SplitList(path) {
if f, err := findExecutable(filepath.Join(dir, file), exts); err == nil {
+ if !filepath.IsAbs(f) {
+ return f, &Error{file, ErrDot}
+ }
return f, nil
}
}
diff --git a/src/os/exec/lp_windows_test.go b/src/os/exec/lp_windows_test.go
index 34abe09..1f609ff 100644
--- a/src/os/exec/lp_windows_test.go
+++ b/src/os/exec/lp_windows_test.go
@@ -8,6 +8,7 @@
package exec_test
import (
+ "errors"
"fmt"
"internal/testenv"
"io"
@@ -36,6 +37,9 @@
func cmdExec(args ...string) {
cmd := exec.Command(args[1])
cmd.Dir = args[0]
+ if errors.Is(cmd.Err, exec.ErrDot) {
+ cmd.Err = nil
+ }
output, err := cmd.CombinedOutput()
if err != nil {
fmt.Fprintf(os.Stderr, "Child: %s %s", err, string(output))
@@ -329,7 +333,7 @@
},
}
-func TestLookPath(t *testing.T) {
+func TestLookPathWindows(t *testing.T) {
tmp := t.TempDir()
printpathExe := buildPrintPathExe(t, tmp)
diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go
index 086ecdb..fec6db7 100644
--- a/src/os/signal/signal_test.go
+++ b/src/os/signal/signal_test.go
@@ -47,11 +47,8 @@
// instead need a test-skip and upstream bug filed against the Solaris
// kernel).
//
- // This constant is chosen so as to make the test as generous as possible
- // while still reliably completing within 3 minutes in non-short mode.
- //
// See https://golang.org/issue/33174.
- settleTime = 11 * time.Second
+ settleTime = 5 * time.Second
} else if runtime.GOOS == "linux" && strings.HasPrefix(runtime.GOARCH, "ppc64") {
// Older linux kernels seem to have some hiccups delivering the signal
// in a timely manner on ppc64 and ppc64le. When running on a
diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go
index 9eb01bd..a625a1d 100644
--- a/src/reflect/all_test.go
+++ b/src/reflect/all_test.go
@@ -1504,6 +1504,10 @@
if m != nil {
t.Errorf("mv.Set(nil) failed")
}
+
+ type S string
+ shouldPanic("not assignable", func() { mv.MapIndex(ValueOf(S("key"))) })
+ shouldPanic("not assignable", func() { mv.SetMapIndex(ValueOf(S("key")), ValueOf(0)) })
}
func TestNilMap(t *testing.T) {
@@ -7265,11 +7269,14 @@
func BenchmarkMap(b *testing.B) {
type V *int
+ type S string
value := ValueOf((V)(nil))
stringKeys := []string{}
mapOfStrings := map[string]V{}
uint64Keys := []uint64{}
mapOfUint64s := map[uint64]V{}
+ userStringKeys := []S{}
+ mapOfUserStrings := map[S]V{}
for i := 0; i < 100; i++ {
stringKey := fmt.Sprintf("key%d", i)
stringKeys = append(stringKeys, stringKey)
@@ -7278,6 +7285,10 @@
uint64Key := uint64(i)
uint64Keys = append(uint64Keys, uint64Key)
mapOfUint64s[uint64Key] = nil
+
+ userStringKey := S(fmt.Sprintf("key%d", i))
+ userStringKeys = append(userStringKeys, userStringKey)
+ mapOfUserStrings[userStringKey] = nil
}
tests := []struct {
@@ -7286,6 +7297,7 @@
}{
{"StringKeys", ValueOf(mapOfStrings), ValueOf(stringKeys), value},
{"Uint64Keys", ValueOf(mapOfUint64s), ValueOf(uint64Keys), value},
+ {"UserStringKeys", ValueOf(mapOfUserStrings), ValueOf(userStringKeys), value},
}
for _, tt := range tests {
diff --git a/src/reflect/value.go b/src/reflect/value.go
index f92fa16..76ae5f8 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -1635,6 +1635,8 @@
panic(&ValueError{"reflect.Value.Len", v.kind()})
}
+var stringType = TypeOf("").(*rtype)
+
// MapIndex returns the value associated with key in the map v.
// It panics if v's Kind is not Map.
// It returns the zero Value if key is not found in the map or if v represents a nil map.
@@ -1652,7 +1654,7 @@
// of unexported fields.
var e unsafe.Pointer
- if key.kind() == String && tt.key.Kind() == String && tt.elem.size <= maxValSize {
+ if (tt.key == stringType || key.kind() == String) && tt.key == key.typ && tt.elem.size <= maxValSize {
k := *(*string)(key.ptr)
e = mapaccess_faststr(v.typ, v.pointer(), k)
} else {
@@ -2278,7 +2280,7 @@
key.mustBeExported()
tt := (*mapType)(unsafe.Pointer(v.typ))
- if key.kind() == String && tt.key.Kind() == String && tt.elem.size <= maxValSize {
+ if (tt.key == stringType || key.kind() == String) && tt.key == key.typ && tt.elem.size <= maxValSize {
k := *(*string)(key.ptr)
if elem.typ == nil {
mapdelete_faststr(v.typ, v.pointer(), k)
diff --git a/src/regexp/syntax/prog.go b/src/regexp/syntax/prog.go
index ee71dec..896cdc4 100644
--- a/src/regexp/syntax/prog.go
+++ b/src/regexp/syntax/prog.go
@@ -102,7 +102,7 @@
return op
}
-// IsWordChar reports whether r is consider a “word character”
+// IsWordChar reports whether r is considered a “word character”
// during the evaluation of the \b and \B zero-width assertions.
// These assertions are ASCII-only: the word characters are [A-Za-z0-9_].
func IsWordChar(r rune) bool {
diff --git a/src/runtime/HACKING.md b/src/runtime/HACKING.md
index 6175524..0ab6bca 100644
--- a/src/runtime/HACKING.md
+++ b/src/runtime/HACKING.md
@@ -90,8 +90,15 @@
details are printed before `throw` using `print` or `println` and the
messages are prefixed with "runtime:".
-For runtime error debugging, it's useful to run with
-`GOTRACEBACK=system` or `GOTRACEBACK=crash`.
+For unrecoverable errors where user code is expected to be at fault for the
+failure (such as racing map writes), use `fatal`.
+
+For runtime error debugging, it may be useful to run with `GOTRACEBACK=system`
+or `GOTRACEBACK=crash`. The output of `panic` and `fatal` is as described by
+`GOTRACEBACK`. The output of `throw` always includes runtime frames, metadata
+and all goroutines regardless of `GOTRACEBACK` (i.e., equivalent to
+`GOTRACEBACK=system). Whether `throw` crashes or not is still controlled by
+`GOTRACEBACK`.
Synchronization
===============
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 3916eaf..6d17d1b 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -85,7 +85,7 @@
func RunSchedLocalQueueTest() {
_p_ := new(p)
gs := make([]g, len(_p_.runq))
- escape(gs) // Ensure gs doesn't move, since we use guintptrs
+ Escape(gs) // Ensure gs doesn't move, since we use guintptrs
for i := 0; i < len(_p_.runq); i++ {
if g, _ := runqget(_p_); g != nil {
throw("runq is not empty initially")
@@ -109,7 +109,7 @@
p1 := new(p)
p2 := new(p)
gs := make([]g, len(p1.runq))
- escape(gs) // Ensure gs doesn't move, since we use guintptrs
+ Escape(gs) // Ensure gs doesn't move, since we use guintptrs
for i := 0; i < len(p1.runq); i++ {
for j := 0; j < i; j++ {
gs[j].sig = 0
@@ -157,7 +157,7 @@
done := make(chan bool, 1)
p := new(p)
gs := make([]g, 2)
- escape(gs) // Ensure gs doesn't move, since we use guintptrs
+ Escape(gs) // Ensure gs doesn't move, since we use guintptrs
ready := new(uint32)
for i := 0; i < iters; i++ {
*ready = 0
@@ -1260,7 +1260,7 @@
// do 64-bit atomics on it, and if it gets stack-allocated
// on a 32-bit architecture, it may get allocated unaligned
// space.
- g := escape(new(GCController))
+ g := Escape(new(GCController))
g.gcControllerState.test = true // Mark it as a test copy.
g.init(int32(gcPercent))
return g
@@ -1334,13 +1334,13 @@
c.setMaxIdleMarkWorkers(max)
}
+var alwaysFalse bool
var escapeSink any
-//go:noinline
-//go:norace
-func escape[T any](x T) T {
- escapeSink = x
- escapeSink = nil
+func Escape[T any](x T) T {
+ if alwaysFalse {
+ escapeSink = x
+ }
return x
}
diff --git a/src/runtime/gc_test.go b/src/runtime/gc_test.go
index 9743dbb..84baa00 100644
--- a/src/runtime/gc_test.go
+++ b/src/runtime/gc_test.go
@@ -284,7 +284,7 @@
runtime.KeepAlive(half)
}
-var pointerClassSink *int
+var pointerClassBSS *int
var pointerClassData = 42
func TestGCTestPointerClass(t *testing.T) {
@@ -300,10 +300,9 @@
}
var onStack int
var notOnStack int
- pointerClassSink = ¬OnStack
check(unsafe.Pointer(&onStack), "stack")
- check(unsafe.Pointer(¬OnStack), "heap")
- check(unsafe.Pointer(&pointerClassSink), "bss")
+ check(unsafe.Pointer(runtime.Escape(¬OnStack)), "heap")
+ check(unsafe.Pointer(&pointerClassBSS), "bss")
check(unsafe.Pointer(&pointerClassData), "data")
check(nil, "other")
}
@@ -614,14 +613,13 @@
for i := range x {
x[i] = new([1024]byte)
}
- hugeSink = x
b.ResetTimer()
for i := 0; i < b.N; i++ {
runtime.ReadMemStats(&ms)
}
- hugeSink = nil
+ runtime.KeepAlive(x)
}
func applyGCLoad(b *testing.B) func() {
diff --git a/src/runtime/gcinfo_test.go b/src/runtime/gcinfo_test.go
index f2c88ef..a0be7ad 100644
--- a/src/runtime/gcinfo_test.go
+++ b/src/runtime/gcinfo_test.go
@@ -77,15 +77,15 @@
}
for i := 0; i < 10; i++ {
- verifyGCInfo(t, "heap Ptr", escape(new(Ptr)), trimDead(infoPtr))
- verifyGCInfo(t, "heap PtrSlice", escape(&make([]*byte, 10)[0]), trimDead(infoPtr10))
- verifyGCInfo(t, "heap ScalarPtr", escape(new(ScalarPtr)), trimDead(infoScalarPtr))
- verifyGCInfo(t, "heap ScalarPtrSlice", escape(&make([]ScalarPtr, 4)[0]), trimDead(infoScalarPtr4))
- verifyGCInfo(t, "heap PtrScalar", escape(new(PtrScalar)), trimDead(infoPtrScalar))
- verifyGCInfo(t, "heap BigStruct", escape(new(BigStruct)), trimDead(infoBigStruct()))
- verifyGCInfo(t, "heap string", escape(new(string)), trimDead(infoString))
- verifyGCInfo(t, "heap eface", escape(new(any)), trimDead(infoEface))
- verifyGCInfo(t, "heap iface", escape(new(Iface)), trimDead(infoIface))
+ verifyGCInfo(t, "heap Ptr", runtime.Escape(new(Ptr)), trimDead(infoPtr))
+ verifyGCInfo(t, "heap PtrSlice", runtime.Escape(&make([]*byte, 10)[0]), trimDead(infoPtr10))
+ verifyGCInfo(t, "heap ScalarPtr", runtime.Escape(new(ScalarPtr)), trimDead(infoScalarPtr))
+ verifyGCInfo(t, "heap ScalarPtrSlice", runtime.Escape(&make([]ScalarPtr, 4)[0]), trimDead(infoScalarPtr4))
+ verifyGCInfo(t, "heap PtrScalar", runtime.Escape(new(PtrScalar)), trimDead(infoPtrScalar))
+ verifyGCInfo(t, "heap BigStruct", runtime.Escape(new(BigStruct)), trimDead(infoBigStruct()))
+ verifyGCInfo(t, "heap string", runtime.Escape(new(string)), trimDead(infoString))
+ verifyGCInfo(t, "heap eface", runtime.Escape(new(any)), trimDead(infoEface))
+ verifyGCInfo(t, "heap iface", runtime.Escape(new(Iface)), trimDead(infoIface))
}
}
@@ -104,13 +104,6 @@
return mask
}
-var gcinfoSink any
-
-func escape(p any) any {
- gcinfoSink = p
- return p
-}
-
var infoPtr = []byte{typePointer}
type Ptr struct {
diff --git a/src/runtime/malloc_test.go b/src/runtime/malloc_test.go
index 8ff8868..cc20076 100644
--- a/src/runtime/malloc_test.go
+++ b/src/runtime/malloc_test.go
@@ -173,12 +173,6 @@
}
}
-var (
- tinyByteSink *byte
- tinyUint32Sink *uint32
- tinyObj12Sink *obj12
-)
-
type obj12 struct {
a uint64
b uint32
@@ -205,8 +199,8 @@
// Make 1-byte allocations until we get a fresh tiny slot.
aligned := false
for i := 0; i < 16; i++ {
- tinyByteSink = new(byte)
- if uintptr(unsafe.Pointer(tinyByteSink))&0xf == 0xf {
+ x := runtime.Escape(new(byte))
+ if uintptr(unsafe.Pointer(x))&0xf == 0xf {
aligned = true
break
}
@@ -218,22 +212,17 @@
// Create a 4-byte object so that the current
// tiny slot is partially filled.
- tinyUint32Sink = new(uint32)
+ runtime.Escape(new(uint32))
// Create a 12-byte object, which fits into the
// tiny slot. If it actually gets place there,
// then the field "a" will be improperly aligned
// for atomic access on 32-bit architectures.
// This won't be true if issue 36606 gets resolved.
- tinyObj12Sink = new(obj12)
+ tinyObj12 := runtime.Escape(new(obj12))
// Try to atomically access "x.a".
- atomic.StoreUint64(&tinyObj12Sink.a, 10)
-
- // Clear the sinks.
- tinyByteSink = nil
- tinyUint32Sink = nil
- tinyObj12Sink = nil
+ atomic.StoreUint64(&tinyObj12.a, 10)
runtime.Releasem()
}
diff --git a/src/runtime/map.go b/src/runtime/map.go
index 2e513e2..65be472 100644
--- a/src/runtime/map.go
+++ b/src/runtime/map.go
@@ -412,7 +412,7 @@
return unsafe.Pointer(&zeroVal[0])
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
hash := t.hasher(key, uintptr(h.hash0))
m := bucketMask(h.B)
@@ -473,7 +473,7 @@
return unsafe.Pointer(&zeroVal[0]), false
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
hash := t.hasher(key, uintptr(h.hash0))
m := bucketMask(h.B)
@@ -592,7 +592,7 @@
asanread(key, t.key.size)
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(key, uintptr(h.hash0))
@@ -683,7 +683,7 @@
done:
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
if t.indirectelem() {
@@ -712,7 +712,7 @@
return
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(key, uintptr(h.hash0))
@@ -803,7 +803,7 @@
}
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
}
@@ -870,7 +870,7 @@
racereadpc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapiternext))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map iteration and map write")
+ fatal("concurrent map iteration and map write")
}
t := it.t
bucket := it.bucket
@@ -1002,7 +1002,7 @@
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags ^= hashWriting
@@ -1033,7 +1033,7 @@
}
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
}
diff --git a/src/runtime/map_fast32.go b/src/runtime/map_fast32.go
index e80caee..01ea330 100644
--- a/src/runtime/map_fast32.go
+++ b/src/runtime/map_fast32.go
@@ -19,7 +19,7 @@
return unsafe.Pointer(&zeroVal[0])
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
var b *bmap
if h.B == 0 {
@@ -59,7 +59,7 @@
return unsafe.Pointer(&zeroVal[0]), false
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
var b *bmap
if h.B == 0 {
@@ -99,7 +99,7 @@
racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast32))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -174,7 +174,7 @@
done:
elem := add(unsafe.Pointer(insertb), dataOffset+bucketCnt*4+inserti*uintptr(t.elemsize))
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
return elem
@@ -189,7 +189,7 @@
racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast32))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -264,7 +264,7 @@
done:
elem := add(unsafe.Pointer(insertb), dataOffset+bucketCnt*4+inserti*uintptr(t.elemsize))
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
return elem
@@ -279,7 +279,7 @@
return
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -355,7 +355,7 @@
}
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
}
diff --git a/src/runtime/map_fast64.go b/src/runtime/map_fast64.go
index 69d8872..2967360 100644
--- a/src/runtime/map_fast64.go
+++ b/src/runtime/map_fast64.go
@@ -19,7 +19,7 @@
return unsafe.Pointer(&zeroVal[0])
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
var b *bmap
if h.B == 0 {
@@ -59,7 +59,7 @@
return unsafe.Pointer(&zeroVal[0]), false
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
var b *bmap
if h.B == 0 {
@@ -99,7 +99,7 @@
racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast64))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -174,7 +174,7 @@
done:
elem := add(unsafe.Pointer(insertb), dataOffset+bucketCnt*8+inserti*uintptr(t.elemsize))
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
return elem
@@ -189,7 +189,7 @@
racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_fast64))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -264,7 +264,7 @@
done:
elem := add(unsafe.Pointer(insertb), dataOffset+bucketCnt*8+inserti*uintptr(t.elemsize))
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
return elem
@@ -279,7 +279,7 @@
return
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
hash := t.hasher(noescape(unsafe.Pointer(&key)), uintptr(h.hash0))
@@ -357,7 +357,7 @@
}
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
}
diff --git a/src/runtime/map_faststr.go b/src/runtime/map_faststr.go
index 4dca882..006c24c 100644
--- a/src/runtime/map_faststr.go
+++ b/src/runtime/map_faststr.go
@@ -19,7 +19,7 @@
return unsafe.Pointer(&zeroVal[0])
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
key := stringStructOf(&ky)
if h.B == 0 {
@@ -114,7 +114,7 @@
return unsafe.Pointer(&zeroVal[0]), false
}
if h.flags&hashWriting != 0 {
- throw("concurrent map read and map write")
+ fatal("concurrent map read and map write")
}
key := stringStructOf(&ky)
if h.B == 0 {
@@ -209,7 +209,7 @@
racewritepc(unsafe.Pointer(h), callerpc, abi.FuncPCABIInternal(mapassign_faststr))
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
key := stringStructOf(&s)
hash := t.hasher(noescape(unsafe.Pointer(&s)), uintptr(h.hash0))
@@ -292,7 +292,7 @@
done:
elem := add(unsafe.Pointer(insertb), dataOffset+bucketCnt*2*goarch.PtrSize+inserti*uintptr(t.elemsize))
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
return elem
@@ -307,7 +307,7 @@
return
}
if h.flags&hashWriting != 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
key := stringStructOf(&ky)
@@ -383,7 +383,7 @@
}
if h.flags&hashWriting == 0 {
- throw("concurrent map writes")
+ fatal("concurrent map writes")
}
h.flags &^= hashWriting
}
diff --git a/src/runtime/map_test.go b/src/runtime/map_test.go
index 5c458b4..4afbae6 100644
--- a/src/runtime/map_test.go
+++ b/src/runtime/map_test.go
@@ -673,8 +673,6 @@
}
}
-var mapSink map[int]int
-
var mapBucketTests = [...]struct {
n int // n is the number of map elements
noescape int // number of expected buckets for non-escaping map
@@ -710,7 +708,7 @@
if got := runtime.MapBucketsCount(localMap); got != tt.noescape {
t.Errorf("no escape: n=%d want %d buckets, got %d", tt.n, tt.noescape, got)
}
- escapingMap := map[int]int{}
+ escapingMap := runtime.Escape(map[int]int{})
if count := runtime.MapBucketsCount(escapingMap); count > 1 && runtime.MapBucketsPointerIsNil(escapingMap) {
t.Errorf("escape: buckets pointer is nil for n=%d buckets", count)
}
@@ -720,7 +718,6 @@
if got := runtime.MapBucketsCount(escapingMap); got != tt.escape {
t.Errorf("escape n=%d want %d buckets, got %d", tt.n, tt.escape, got)
}
- mapSink = escapingMap
}
})
t.Run("nohint", func(t *testing.T) {
@@ -735,7 +732,7 @@
if got := runtime.MapBucketsCount(localMap); got != tt.noescape {
t.Errorf("no escape: n=%d want %d buckets, got %d", tt.n, tt.noescape, got)
}
- escapingMap := make(map[int]int)
+ escapingMap := runtime.Escape(make(map[int]int))
if count := runtime.MapBucketsCount(escapingMap); count > 1 && runtime.MapBucketsPointerIsNil(escapingMap) {
t.Errorf("escape: buckets pointer is nil for n=%d buckets", count)
}
@@ -745,7 +742,6 @@
if got := runtime.MapBucketsCount(escapingMap); got != tt.escape {
t.Errorf("escape: n=%d want %d buckets, got %d", tt.n, tt.escape, got)
}
- mapSink = escapingMap
}
})
t.Run("makemap", func(t *testing.T) {
@@ -760,7 +756,7 @@
if got := runtime.MapBucketsCount(localMap); got != tt.noescape {
t.Errorf("no escape: n=%d want %d buckets, got %d", tt.n, tt.noescape, got)
}
- escapingMap := make(map[int]int, tt.n)
+ escapingMap := runtime.Escape(make(map[int]int, tt.n))
if count := runtime.MapBucketsCount(escapingMap); count > 1 && runtime.MapBucketsPointerIsNil(escapingMap) {
t.Errorf("escape: buckets pointer is nil for n=%d buckets", count)
}
@@ -770,7 +766,6 @@
if got := runtime.MapBucketsCount(escapingMap); got != tt.escape {
t.Errorf("escape: n=%d want %d buckets, got %d", tt.n, tt.escape, got)
}
- mapSink = escapingMap
}
})
t.Run("makemap64", func(t *testing.T) {
@@ -785,7 +780,7 @@
if got := runtime.MapBucketsCount(localMap); got != tt.noescape {
t.Errorf("no escape: n=%d want %d buckets, got %d", tt.n, tt.noescape, got)
}
- escapingMap := make(map[int]int, tt.n)
+ escapingMap := runtime.Escape(make(map[int]int, tt.n))
if count := runtime.MapBucketsCount(escapingMap); count > 1 && runtime.MapBucketsPointerIsNil(escapingMap) {
t.Errorf("escape: buckets pointer is nil for n=%d buckets", count)
}
@@ -795,7 +790,6 @@
if got := runtime.MapBucketsCount(escapingMap); got != tt.escape {
t.Errorf("escape: n=%d want %d buckets, got %d", tt.n, tt.escape, got)
}
- mapSink = escapingMap
}
})
diff --git a/src/runtime/os3_plan9.go b/src/runtime/os3_plan9.go
index a06d74e..e901b3e 100644
--- a/src/runtime/os3_plan9.go
+++ b/src/runtime/os3_plan9.go
@@ -120,7 +120,7 @@
return _NCONT
}
Throw:
- _g_.m.throwing = 1
+ _g_.m.throwing = throwTypeRuntime
_g_.m.caughtsig.set(gp)
startpanic_m()
print(notestr, "\n")
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go
index a6e7a33..154f27c 100644
--- a/src/runtime/os_linux.go
+++ b/src/runtime/os_linux.go
@@ -880,7 +880,7 @@
if errno != 0 || r1 != args.r1 || r2 != args.r2 {
print("trap:", args.trap, ", a123456=[", args.a1, ",", args.a2, ",", args.a3, ",", args.a4, ",", args.a5, ",", args.a6, "]\n")
print("results: got {r1=", r1, ",r2=", r2, ",errno=", errno, "}, want {r1=", args.r1, ",r2=", args.r2, ",errno=0\n")
- throw("AllThreadsSyscall6 results differ between threads; runtime corrupted")
+ fatal("AllThreadsSyscall6 results differ between threads; runtime corrupted")
}
gp.m.needPerThreadSyscall.Store(0)
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index e4cc7bf..d9c72df 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -11,6 +11,28 @@
"unsafe"
)
+// throwType indicates the current type of ongoing throw, which affects the
+// amount of detail printed to stderr. Higher values include more detail.
+type throwType uint32
+
+const (
+ // throwTypeNone means that we are not throwing.
+ throwTypeNone throwType = iota
+
+ // throwTypeUser is a throw due to a problem with the application.
+ //
+ // These throws do not include runtime frames, system goroutines, or
+ // frame metadata.
+ throwTypeUser
+
+ // throwTypeRuntime is a throw due to a problem with Go itself.
+ //
+ // These throws include as much information as possible to aid in
+ // debugging the runtime, including runtime frames, system goroutines,
+ // and frame metadata.
+ throwTypeRuntime
+)
+
// We have two different ways of doing defers. The older way involves creating a
// defer record at the time that a defer statement is executing and adding it to a
// defer chain. This chain is inspected by the deferreturn call at all function
@@ -986,6 +1008,15 @@
throw(s)
}
+//go:linkname sync_fatal sync.fatal
+func sync_fatal(s string) {
+ fatal(s)
+}
+
+// throw triggers a fatal error that dumps a stack trace and exits.
+//
+// throw should be used for runtime-internal fatal errors where Go itself,
+// rather than user code, may be at fault for the failure.
//go:nosplit
func throw(s string) {
// Everything throw does should be recursively nosplit so it
@@ -993,12 +1024,26 @@
systemstack(func() {
print("fatal error: ", s, "\n")
})
- gp := getg()
- if gp.m.throwing == 0 {
- gp.m.throwing = 1
- }
- fatalthrow()
- *(*int)(nil) = 0 // not reached
+
+ fatalthrow(throwTypeRuntime)
+}
+
+// fatal triggers a fatal error that dumps a stack trace and exits.
+//
+// fatal is equivalent to throw, but is used when user code is expected to be
+// at fault for the failure, such as racing map writes.
+//
+// fatal does not include runtime frames, system goroutines, or frame metadata
+// (fp, sp, pc) in the stack trace unless GOTRACEBACK=system or higher.
+//go:nosplit
+func fatal(s string) {
+ // Everything fatal does should be recursively nosplit so it
+ // can be called even when it's unsafe to grow the stack.
+ systemstack(func() {
+ print("fatal error: ", s, "\n")
+ })
+
+ fatalthrow(throwTypeUser)
}
// runningPanicDefers is non-zero while running deferred functions for panic.
@@ -1043,12 +1088,17 @@
// process.
//
//go:nosplit
-func fatalthrow() {
+func fatalthrow(t throwType) {
pc := getcallerpc()
sp := getcallersp()
gp := getg()
- // Switch to the system stack to avoid any stack growth, which
- // may make things worse if the runtime is in a bad state.
+
+ if gp.m.throwing == throwTypeNone {
+ gp.m.throwing = t
+ }
+
+ // Switch to the system stack to avoid any stack growth, which may make
+ // things worse if the runtime is in a bad state.
systemstack(func() {
startpanic_m()
@@ -1191,7 +1241,7 @@
print("\n")
goroutineheader(gp)
traceback(pc, sp, 0, gp)
- } else if level >= 2 || _g_.m.throwing > 0 {
+ } else if level >= 2 || _g_.m.throwing >= throwTypeRuntime {
print("\nruntime stack:\n")
traceback(pc, sp, 0, gp)
}
@@ -1233,7 +1283,7 @@
if gp == nil || gp != mp.curg {
return false
}
- if mp.locks != 0 || mp.mallocing != 0 || mp.throwing != 0 || mp.preemptoff != "" || mp.dying != 0 {
+ if mp.locks != 0 || mp.mallocing != 0 || mp.throwing != throwTypeNone || mp.preemptoff != "" || mp.dying != 0 {
return false
}
status := readgstatus(gp)
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index b72194c..2bf5c55 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4088,8 +4088,7 @@
_g_ := getg()
if fn == nil {
- _g_.m.throwing = -1 // do not dump full stacks
- throw("go of nil func value")
+ fatal("go of nil func value")
}
acquirem() // disable preemption because it can be holding p in a local var
@@ -5012,7 +5011,7 @@
})
if grunning == 0 { // possible if main goroutine calls runtime·Goexit()
unlock(&sched.lock) // unlock so that GODEBUG=scheddetail=1 doesn't hang
- throw("no goroutines (main called runtime.Goexit) - deadlock!")
+ fatal("no goroutines (main called runtime.Goexit) - deadlock!")
}
// Maybe jump time forward for playground.
@@ -5045,9 +5044,8 @@
}
}
- getg().m.throwing = -1 // do not dump full stacks
unlock(&sched.lock) // unlock so that GODEBUG=scheddetail=1 doesn't hang
- throw("all goroutines are asleep - deadlock!")
+ fatal("all goroutines are asleep - deadlock!")
}
// forcegcperiod is the maximum time in nanoseconds between garbage
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index 5429aa2..62ecbdf 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -38,9 +38,13 @@
_g_ := getg()
t := atomic.Load(&traceback_cache)
crash = t&tracebackCrash != 0
- all = _g_.m.throwing > 0 || t&tracebackAll != 0
+ all = _g_.m.throwing >= throwTypeUser || t&tracebackAll != 0
if _g_.m.traceback != 0 {
level = int32(_g_.m.traceback)
+ } else if _g_.m.throwing >= throwTypeRuntime {
+ // Always include runtime frames in runtime throws unless
+ // otherwise overridden by m.traceback.
+ level = 2
} else {
level = int32(t >> tracebackShift)
}
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index b2c42d0..e4b7bec 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -532,7 +532,7 @@
oldp puintptr // the p that was attached before executing a syscall
id int64
mallocing int32
- throwing int32
+ throwing throwType
preemptoff string // if != "", keep curg running on this m
locks int32
dying int32
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go
index 3db7893..66a5c94 100644
--- a/src/runtime/signal_unix.go
+++ b/src/runtime/signal_unix.go
@@ -698,7 +698,7 @@
return
}
- _g_.m.throwing = 1
+ _g_.m.throwing = throwTypeRuntime
_g_.m.caughtsig.set(gp)
if crashing == 0 {
diff --git a/src/runtime/signal_windows.go b/src/runtime/signal_windows.go
index 16c36d0..c5cf38c 100644
--- a/src/runtime/signal_windows.go
+++ b/src/runtime/signal_windows.go
@@ -226,7 +226,7 @@
}
print("\n")
- _g_.m.throwing = 1
+ _g_.m.throwing = throwTypeRuntime
_g_.m.caughtsig.set(gp)
level, _, docrash := gotraceback()
diff --git a/src/runtime/sys_aix_ppc64.s b/src/runtime/sys_aix_ppc64.s
index 217ebb8..772f357 100644
--- a/src/runtime/sys_aix_ppc64.s
+++ b/src/runtime/sys_aix_ppc64.s
@@ -101,7 +101,7 @@
// This function must not have any frame as we want to control how
// every registers are used.
// TODO(aix): Implement SetCgoTraceback handler.
-TEXT sigtramp<>(SB),NOSPLIT|NOFRAME,$0
+TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
MOVD LR, R0
MOVD R0, 16(R1)
// initialize essential registers (just in case)
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index 8e75a38..ba81fcc 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -214,7 +214,7 @@
// This is the function registered during sigaction and is invoked when
// a signal is received. It just redirects to the Go function sigtrampgo.
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s
index dc7c9bf..bf0dc9d 100644
--- a/src/runtime/sys_darwin_arm64.s
+++ b/src/runtime/sys_darwin_arm64.s
@@ -176,7 +176,7 @@
BL (R11)
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$176
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)
diff --git a/src/runtime/sys_dragonfly_amd64.s b/src/runtime/sys_dragonfly_amd64.s
index 48b04ff..602d5e9 100644
--- a/src/runtime/sys_dragonfly_amd64.s
+++ b/src/runtime/sys_dragonfly_amd64.s
@@ -222,7 +222,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_freebsd_386.s b/src/runtime/sys_freebsd_386.s
index aceb6fe..9e5210b 100644
--- a/src/runtime/sys_freebsd_386.s
+++ b/src/runtime/sys_freebsd_386.s
@@ -253,7 +253,7 @@
RET
// Called by OS using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$12
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$12
NOP SP // tell vet SP changed - stop checking offsets
MOVL 16(SP), BX // signo
MOVL BX, 0(SP)
diff --git a/src/runtime/sys_freebsd_amd64.s b/src/runtime/sys_freebsd_amd64.s
index 159f5c6..94341f6 100644
--- a/src/runtime/sys_freebsd_amd64.s
+++ b/src/runtime/sys_freebsd_amd64.s
@@ -224,7 +224,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_freebsd_arm.s b/src/runtime/sys_freebsd_arm.s
index 88ab0fc..cbee34d 100644
--- a/src/runtime/sys_freebsd_arm.s
+++ b/src/runtime/sys_freebsd_arm.s
@@ -231,7 +231,7 @@
MOVW R0, ret+12(FP)
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13
diff --git a/src/runtime/sys_freebsd_arm64.s b/src/runtime/sys_freebsd_arm64.s
index a4f12eb..5dcdf37 100644
--- a/src/runtime/sys_freebsd_arm64.s
+++ b/src/runtime/sys_freebsd_arm64.s
@@ -280,7 +280,7 @@
RET
// func sigtramp()
-TEXT runtime·sigtramp(SB),NOSPLIT,$176
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s
index fef68d51..4942f21 100644
--- a/src/runtime/sys_linux_386.s
+++ b/src/runtime/sys_linux_386.s
@@ -433,7 +433,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$28
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$28
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)
MOVL BP, bp-8(SP)
diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s
index f2dfbbb7..ca6ecb1 100644
--- a/src/runtime/sys_linux_amd64.s
+++ b/src/runtime/sys_linux_amd64.s
@@ -339,7 +339,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s
index 201940b..66bf403 100644
--- a/src/runtime/sys_linux_arm.s
+++ b/src/runtime/sys_linux_arm.s
@@ -566,7 +566,7 @@
MOVW R4, R13
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13
diff --git a/src/runtime/sys_linux_arm64.s b/src/runtime/sys_linux_arm64.s
index 8e7cbf7..b47b6fd 100644
--- a/src/runtime/sys_linux_arm64.s
+++ b/src/runtime/sys_linux_arm64.s
@@ -445,7 +445,7 @@
RET
// Called from c-abi, R0: sig, R1: info, R2: cxt
-TEXT runtime·sigtramp(SB),NOSPLIT,$176
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)
diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s
index 3c7f0e7..06d54df 100644
--- a/src/runtime/sys_linux_mips64x.s
+++ b/src/runtime/sys_linux_mips64x.s
@@ -405,7 +405,7 @@
JAL (R25)
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$64
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$64
// initialize REGSB = PC&0xffffffff00000000
BGEZAL R0, 1(PC)
SRLV $32, R31, RSB
diff --git a/src/runtime/sys_linux_mipsx.s b/src/runtime/sys_linux_mipsx.s
index ab4e976..e70edcc 100644
--- a/src/runtime/sys_linux_mipsx.s
+++ b/src/runtime/sys_linux_mipsx.s
@@ -311,7 +311,7 @@
MOVW R22, R29
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$12
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$12
// this might be called in external code context,
// where g is not set.
MOVB runtime·iscgo(SB), R1
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s
index 48f9334..2913a05 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -459,7 +459,7 @@
DWORD $sigtramp<>(SB)
DWORD $0
DWORD $0
-TEXT sigtramp<>(SB),NOSPLIT|NOFRAME,$0
+TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
#endif
// Start with standard C stack frame layout and linkage.
MOVD LR, R0
diff --git a/src/runtime/sys_linux_riscv64.s b/src/runtime/sys_linux_riscv64.s
index 8dde29e..afb2d11 100644
--- a/src/runtime/sys_linux_riscv64.s
+++ b/src/runtime/sys_linux_riscv64.s
@@ -417,7 +417,7 @@
RET
// func sigtramp(signo, ureg, ctxt unsafe.Pointer)
-TEXT runtime·sigtramp(SB),NOSPLIT,$64
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$64
MOVW A0, 8(X2)
MOV A1, 16(X2)
MOV A2, 24(X2)
diff --git a/src/runtime/sys_linux_s390x.s b/src/runtime/sys_linux_s390x.s
index 03ec7f0..91ce1b3 100644
--- a/src/runtime/sys_linux_s390x.s
+++ b/src/runtime/sys_linux_s390x.s
@@ -272,7 +272,7 @@
TEXT runtime·sigreturn(SB),NOSPLIT,$0-0
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$64
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$64
// initialize essential registers (just in case)
XOR R0, R0
diff --git a/src/runtime/sys_netbsd_386.s b/src/runtime/sys_netbsd_386.s
index b7d4645..581b4fc 100644
--- a/src/runtime/sys_netbsd_386.s
+++ b/src/runtime/sys_netbsd_386.s
@@ -290,7 +290,7 @@
RET
// Called by OS using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$28
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$28
NOP SP // tell vet SP changed - stop checking offsets
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)
diff --git a/src/runtime/sys_netbsd_amd64.s b/src/runtime/sys_netbsd_amd64.s
index ade1136..ab11f6f 100644
--- a/src/runtime/sys_netbsd_amd64.s
+++ b/src/runtime/sys_netbsd_amd64.s
@@ -305,7 +305,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_netbsd_arm.s b/src/runtime/sys_netbsd_arm.s
index bbca040..dbe3dbc 100644
--- a/src/runtime/sys_netbsd_arm.s
+++ b/src/runtime/sys_netbsd_arm.s
@@ -288,7 +288,7 @@
MOVW R4, R13
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13
diff --git a/src/runtime/sys_netbsd_arm64.s b/src/runtime/sys_netbsd_arm64.s
index 6bcd344..fc126ca 100644
--- a/src/runtime/sys_netbsd_arm64.s
+++ b/src/runtime/sys_netbsd_arm64.s
@@ -295,7 +295,7 @@
BL (R11)
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$176
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)
diff --git a/src/runtime/sys_openbsd_386.s b/src/runtime/sys_openbsd_386.s
index 890b96b..963678a 100644
--- a/src/runtime/sys_openbsd_386.s
+++ b/src/runtime/sys_openbsd_386.s
@@ -69,7 +69,7 @@
RET
// Called by OS using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$28
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$28
NOP SP // tell vet SP changed - stop checking offsets
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)
diff --git a/src/runtime/sys_openbsd_amd64.s b/src/runtime/sys_openbsd_amd64.s
index f71f5cc..2c026c8 100644
--- a/src/runtime/sys_openbsd_amd64.s
+++ b/src/runtime/sys_openbsd_amd64.s
@@ -58,7 +58,7 @@
RET
// Called using C ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()
diff --git a/src/runtime/sys_openbsd_arm.s b/src/runtime/sys_openbsd_arm.s
index a9cb1fb..e03cfb5 100644
--- a/src/runtime/sys_openbsd_arm.s
+++ b/src/runtime/sys_openbsd_arm.s
@@ -61,7 +61,7 @@
MOVW R9, R13
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13
diff --git a/src/runtime/sys_openbsd_arm64.s b/src/runtime/sys_openbsd_arm64.s
index 4a3f2fc3..db92326 100644
--- a/src/runtime/sys_openbsd_arm64.s
+++ b/src/runtime/sys_openbsd_arm64.s
@@ -51,7 +51,7 @@
BL (R11) // Alignment for ELF ABI?
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$192
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$192
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)
diff --git a/src/runtime/sys_openbsd_mips64.s b/src/runtime/sys_openbsd_mips64.s
index 3b18bdd..c2b2092 100644
--- a/src/runtime/sys_openbsd_mips64.s
+++ b/src/runtime/sys_openbsd_mips64.s
@@ -237,7 +237,7 @@
CALL (R25)
RET
-TEXT runtime·sigtramp(SB),NOSPLIT,$192
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$192
// initialize REGSB = PC&0xffffffff00000000
BGEZAL R0, 1(PC)
SRLV $32, R31, RSB
diff --git a/src/runtime/sys_solaris_amd64.s b/src/runtime/sys_solaris_amd64.s
index 24d2d61..7376e06 100644
--- a/src/runtime/sys_solaris_amd64.s
+++ b/src/runtime/sys_solaris_amd64.s
@@ -121,7 +121,7 @@
// Careful, this is called by __sighndlr, a libc function. We must preserve
// registers as per AMD 64 ABI.
-TEXT runtime·sigtramp(SB),NOSPLIT,$0
+TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Note that we are executing on altsigstack here, so we have
// more stack available than NOSPLIT would have us believe.
// To defeat the linker, we make our own stack frame with
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 9187d1f..197683b 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -82,6 +82,7 @@
}
waspanic := false
cgoCtxt := gp.cgoCtxt
+ stack := gp.stack
printing := pcbuf == nil && callback == nil
// If the PC is zero, it's likely a nil function call.
@@ -114,7 +115,7 @@
if !f.valid() {
if callback != nil || printing {
print("runtime: g ", gp.goid, ": unknown pc ", hex(frame.pc), "\n")
- tracebackHexdump(gp.stack, &frame, 0)
+ tracebackHexdump(stack, &frame, 0)
}
if callback != nil {
throw("unknown pc")
@@ -174,12 +175,15 @@
frame.fn = findfunc(frame.pc)
f = frame.fn
flag = f.flag
+ frame.lr = gp.m.curg.sched.lr
frame.sp = gp.m.curg.sched.sp
+ stack = gp.m.curg.stack
cgoCtxt = gp.m.curg.cgoCtxt
case funcID_systemstack:
// systemstack returns normally, so just follow the
// stack transition.
frame.sp = gp.m.curg.sched.sp
+ stack = gp.m.curg.stack
cgoCtxt = gp.m.curg.cgoCtxt
flag &^= funcFlag_SPWRITE
}
@@ -248,7 +252,7 @@
}
if callback != nil || doPrint {
print("runtime: g ", gp.goid, ": unexpected return pc for ", funcname(f), " called from ", hex(frame.lr), "\n")
- tracebackHexdump(gp.stack, &frame, lrPtr)
+ tracebackHexdump(stack, &frame, lrPtr)
}
if callback != nil {
throw("unknown caller pc")
@@ -447,7 +451,7 @@
if frame.pc > f.entry() {
print(" +", hex(frame.pc-f.entry()))
}
- if gp.m != nil && gp.m.throwing > 0 && gp == gp.m.curg || level >= 2 {
+ if gp.m != nil && gp.m.throwing >= throwTypeRuntime && gp == gp.m.curg || level >= 2 {
print(" fp=", hex(frame.fp), " sp=", hex(frame.sp), " pc=", hex(frame.pc))
}
print("\n")
@@ -477,6 +481,13 @@
break
}
+ if frame.pc == frame.lr && frame.sp == frame.fp {
+ // If the next frame is identical to the current frame, we cannot make progress.
+ print("runtime: traceback stuck. pc=", hex(frame.pc), " sp=", hex(frame.sp), "\n")
+ tracebackHexdump(stack, &frame, frame.sp)
+ throw("traceback stuck")
+ }
+
// Unwind to next frame.
frame.fn = flr
frame.pc = frame.lr
@@ -913,7 +924,7 @@
// be printed during a traceback.
func showframe(f funcInfo, gp *g, firstFrame bool, funcID, childID funcID) bool {
g := getg()
- if g.m.throwing > 0 && gp != nil && (gp == g.m.curg || gp == g.m.caughtsig.ptr()) {
+ if g.m.throwing >= throwTypeRuntime && gp != nil && (gp == g.m.curg || gp == g.m.caughtsig.ptr()) {
return true
}
return showfuncinfo(f, firstFrame, funcID, childID)
diff --git a/src/strings/strings.go b/src/strings/strings.go
index a563f37..1dc4238 100644
--- a/src/strings/strings.go
+++ b/src/strings/strings.go
@@ -962,7 +962,8 @@
for ; stop > start; stop-- {
c := s[stop-1]
if c >= utf8.RuneSelf {
- return TrimFunc(s[start:stop], unicode.IsSpace)
+ // start has been already trimmed above, should trim end only
+ return TrimRightFunc(s[start:stop], unicode.IsSpace)
}
if asciiSpace[c] == 0 {
break
diff --git a/src/sync/atomic/value.go b/src/sync/atomic/value.go
index f18b7ee..88315f2 100644
--- a/src/sync/atomic/value.go
+++ b/src/sync/atomic/value.go
@@ -101,7 +101,7 @@
// active spin wait to wait for completion; and so that
// GC does not see the fake type accidentally.
runtime_procPin()
- if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(^uintptr(0))) {
+ if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(&firstStoreInProgress)) {
runtime_procUnpin()
continue
}
@@ -111,7 +111,7 @@
runtime_procUnpin()
return nil
}
- if uintptr(typ) == ^uintptr(0) {
+ if typ == unsafe.Pointer(&firstStoreInProgress) {
// First store in progress. Wait.
// Since we disable preemption around the first store,
// we can wait with active spinning.
@@ -153,7 +153,7 @@
// active spin wait to wait for completion; and so that
// GC does not see the fake type accidentally.
runtime_procPin()
- if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(^uintptr(0))) {
+ if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(&firstStoreInProgress)) {
runtime_procUnpin()
continue
}
@@ -163,7 +163,7 @@
runtime_procUnpin()
return true
}
- if uintptr(typ) == ^uintptr(0) {
+ if typ == unsafe.Pointer(&firstStoreInProgress) {
// First store in progress. Wait.
// Since we disable preemption around the first store,
// we can wait with active spinning.
diff --git a/src/sync/mutex.go b/src/sync/mutex.go
index 18b2ced..80bb827 100644
--- a/src/sync/mutex.go
+++ b/src/sync/mutex.go
@@ -16,7 +16,9 @@
"unsafe"
)
-func throw(string) // provided by runtime
+// Provided by runtime via linkname.
+func throw(string)
+func fatal(string)
// A Mutex is a mutual exclusion lock.
// The zero value for a Mutex is an unlocked mutex.
@@ -217,7 +219,7 @@
func (m *Mutex) unlockSlow(new int32) {
if (new+mutexLocked)&mutexLocked == 0 {
- throw("sync: unlock of unlocked mutex")
+ fatal("sync: unlock of unlocked mutex")
}
if new&mutexStarving == 0 {
old := new
diff --git a/src/sync/rwmutex.go b/src/sync/rwmutex.go
index f0d4c97..7b10808 100644
--- a/src/sync/rwmutex.go
+++ b/src/sync/rwmutex.go
@@ -118,7 +118,7 @@
func (rw *RWMutex) rUnlockSlow(r int32) {
if r+1 == 0 || r+1 == -rwmutexMaxReaders {
race.Enable()
- throw("sync: RUnlock of unlocked RWMutex")
+ fatal("sync: RUnlock of unlocked RWMutex")
}
// A writer is pending.
if atomic.AddInt32(&rw.readerWait, -1) == 0 {
@@ -198,7 +198,7 @@
r := atomic.AddInt32(&rw.readerCount, rwmutexMaxReaders)
if r >= rwmutexMaxReaders {
race.Enable()
- throw("sync: Unlock of unlocked RWMutex")
+ fatal("sync: Unlock of unlocked RWMutex")
}
// Unblock blocked readers, if any.
for i := 0; i < int(r); i++ {
diff --git a/src/syscall/syscall_linux.go b/src/syscall/syscall_linux.go
index f9adecd..ab634a2 100644
--- a/src/syscall/syscall_linux.go
+++ b/src/syscall/syscall_linux.go
@@ -46,11 +46,15 @@
// uintptr arguments are pointers, because some values may look like pointers,
// but not really be pointers, and adjusting their value would break the call.
//
+// //go:norace, on RawSyscall, to avoid race instrumentation if RawSyscall is
+// called after fork, or from a signal handler.
+//
// //go:linkname to ensure ABI wrappers are generated for external callers
// (notably x/sys/unix assembly).
//go:uintptrkeepalive
//go:nosplit
+//go:norace
//go:linkname RawSyscall
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
return RawSyscall6(trap, a1, a2, a3, 0, 0, 0)
diff --git a/src/vendor/golang.org/x/net/dns/dnsmessage/message.go b/src/vendor/golang.org/x/net/dns/dnsmessage/message.go
index 8c24430..0cdf89f 100644
--- a/src/vendor/golang.org/x/net/dns/dnsmessage/message.go
+++ b/src/vendor/golang.org/x/net/dns/dnsmessage/message.go
@@ -1173,6 +1173,7 @@
// A Builder allows incrementally packing a DNS message.
//
// Example usage:
+//
// buf := make([]byte, 2, 514)
// b := NewBuilder(buf, Header{...})
// b.EnableCompression()
diff --git a/src/vendor/golang.org/x/net/http/httpguts/httplex.go b/src/vendor/golang.org/x/net/http/httpguts/httplex.go
index c79aa73..6e071e8 100644
--- a/src/vendor/golang.org/x/net/http/httpguts/httplex.go
+++ b/src/vendor/golang.org/x/net/http/httpguts/httplex.go
@@ -173,13 +173,15 @@
// isLWS reports whether b is linear white space, according
// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2
-// LWS = [CRLF] 1*( SP | HT )
+//
+// LWS = [CRLF] 1*( SP | HT )
func isLWS(b byte) bool { return b == ' ' || b == '\t' }
// isCTL reports whether b is a control byte, according
// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2
-// CTL = <any US-ASCII control character
-// (octets 0 - 31) and DEL (127)>
+//
+// CTL = <any US-ASCII control character
+// (octets 0 - 31) and DEL (127)>
func isCTL(b byte) bool {
const del = 0x7f // a CTL
return b < ' ' || b == del
@@ -189,12 +191,13 @@
// HTTP/2 imposes the additional restriction that uppercase ASCII
// letters are not allowed.
//
-// RFC 7230 says:
-// header-field = field-name ":" OWS field-value OWS
-// field-name = token
-// token = 1*tchar
-// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
-// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
+// RFC 7230 says:
+//
+// header-field = field-name ":" OWS field-value OWS
+// field-name = token
+// token = 1*tchar
+// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
+// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
func ValidHeaderFieldName(v string) bool {
if len(v) == 0 {
return false
@@ -267,27 +270,28 @@
// ValidHeaderFieldValue reports whether v is a valid "field-value" according to
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 :
//
-// message-header = field-name ":" [ field-value ]
-// field-value = *( field-content | LWS )
-// field-content = <the OCTETs making up the field-value
-// and consisting of either *TEXT or combinations
-// of token, separators, and quoted-string>
+// message-header = field-name ":" [ field-value ]
+// field-value = *( field-content | LWS )
+// field-content = <the OCTETs making up the field-value
+// and consisting of either *TEXT or combinations
+// of token, separators, and quoted-string>
//
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 :
//
-// TEXT = <any OCTET except CTLs,
-// but including LWS>
-// LWS = [CRLF] 1*( SP | HT )
-// CTL = <any US-ASCII control character
-// (octets 0 - 31) and DEL (127)>
+// TEXT = <any OCTET except CTLs,
+// but including LWS>
+// LWS = [CRLF] 1*( SP | HT )
+// CTL = <any US-ASCII control character
+// (octets 0 - 31) and DEL (127)>
//
// RFC 7230 says:
-// field-value = *( field-content / obs-fold )
-// obj-fold = N/A to http2, and deprecated
-// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
-// field-vchar = VCHAR / obs-text
-// obs-text = %x80-FF
-// VCHAR = "any visible [USASCII] character"
+//
+// field-value = *( field-content / obs-fold )
+// obj-fold = N/A to http2, and deprecated
+// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+// field-vchar = VCHAR / obs-text
+// obs-text = %x80-FF
+// VCHAR = "any visible [USASCII] character"
//
// http2 further says: "Similarly, HTTP/2 allows header field values
// that are not valid. While most of the values that can be encoded
diff --git a/src/vendor/golang.org/x/net/http/httpproxy/proxy.go b/src/vendor/golang.org/x/net/http/httpproxy/proxy.go
index d2c8c87..16994ac 100644
--- a/src/vendor/golang.org/x/net/http/httpproxy/proxy.go
+++ b/src/vendor/golang.org/x/net/http/httpproxy/proxy.go
@@ -267,6 +267,9 @@
matchHost = true
phost = "." + phost
}
+ if v, err := idnaASCII(phost); err == nil {
+ phost = v
+ }
c.domainMatchers = append(c.domainMatchers, domainMatch{host: phost, port: pport, matchHost: matchHost})
}
}
diff --git a/src/vendor/golang.org/x/net/idna/trieval.go b/src/vendor/golang.org/x/net/idna/trieval.go
index 7a8cf88..9c070a4 100644
--- a/src/vendor/golang.org/x/net/idna/trieval.go
+++ b/src/vendor/golang.org/x/net/idna/trieval.go
@@ -17,23 +17,23 @@
//
// The per-rune values have the following format:
//
-// if mapped {
-// if inlinedXOR {
-// 15..13 inline XOR marker
-// 12..11 unused
-// 10..3 inline XOR mask
-// } else {
-// 15..3 index into xor or mapping table
-// }
-// } else {
-// 15..14 unused
-// 13 mayNeedNorm
-// 12..11 attributes
-// 10..8 joining type
-// 7..3 category type
-// }
-// 2 use xor pattern
-// 1..0 mapped category
+// if mapped {
+// if inlinedXOR {
+// 15..13 inline XOR marker
+// 12..11 unused
+// 10..3 inline XOR mask
+// } else {
+// 15..3 index into xor or mapping table
+// }
+// } else {
+// 15..14 unused
+// 13 mayNeedNorm
+// 12..11 attributes
+// 10..8 joining type
+// 7..3 category type
+// }
+// 2 use xor pattern
+// 1..0 mapped category
//
// See the definitions below for a more detailed description of the various
// bits.
diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt
index f9ae2c6..3bc4232 100644
--- a/src/vendor/modules.txt
+++ b/src/vendor/modules.txt
@@ -9,7 +9,7 @@
golang.org/x/crypto/hkdf
golang.org/x/crypto/internal/poly1305
golang.org/x/crypto/internal/subtle
-# golang.org/x/net v0.0.0-20220225172249-27dd8689420f
+# golang.org/x/net v0.0.0-20220421235706-1d1ef9303861
## explicit; go 1.17
golang.org/x/net/dns/dnsmessage
golang.org/x/net/http/httpguts
diff --git a/test/fixedbugs/issue52590.dir/a.go b/test/fixedbugs/issue52590.dir/a.go
new file mode 100644
index 0000000..20031e6
--- /dev/null
+++ b/test/fixedbugs/issue52590.dir/a.go
@@ -0,0 +1,68 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+import "unsafe"
+
+func Append() {
+ _ = append(appendArgs())
+}
+
+func Delete() {
+ delete(deleteArgs())
+}
+
+func Print() {
+ print(ints())
+}
+
+func Println() {
+ println(ints())
+}
+
+func Complex() {
+ _ = complex(float64s())
+}
+
+func Copy() {
+ copy(slices())
+}
+
+func UnsafeAdd() {
+ _ = unsafe.Add(unsafeAdd())
+}
+
+func UnsafeSlice() {
+ _ = unsafe.Slice(unsafeSlice())
+}
+
+func appendArgs() ([]int, int) {
+ return []int{}, 0
+}
+
+func deleteArgs() (map[int]int, int) {
+ return map[int]int{}, 0
+}
+
+func ints() (int, int) {
+ return 1, 1
+}
+
+func float64s() (float64, float64) {
+ return 0, 0
+}
+
+func slices() ([]int, []int) {
+ return []int{}, []int{}
+}
+
+func unsafeAdd() (unsafe.Pointer, int) {
+ return nil, 0
+}
+
+func unsafeSlice() (*byte, int) {
+ var p [10]byte
+ return &p[0], 0
+}
diff --git a/test/fixedbugs/issue52590.dir/b.go b/test/fixedbugs/issue52590.dir/b.go
new file mode 100644
index 0000000..264e8d1
--- /dev/null
+++ b/test/fixedbugs/issue52590.dir/b.go
@@ -0,0 +1,18 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package b
+
+import "./a"
+
+func f() {
+ a.Append()
+ a.Delete()
+ a.Print()
+ a.Println()
+ a.Complex()
+ a.Copy()
+ a.UnsafeAdd()
+ a.UnsafeSlice()
+}
diff --git a/test/fixedbugs/issue52590.go b/test/fixedbugs/issue52590.go
new file mode 100644
index 0000000..8bb5c3e
--- /dev/null
+++ b/test/fixedbugs/issue52590.go
@@ -0,0 +1,7 @@
+// compiledir
+
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/test/fixedbugs/issue52612.go b/test/fixedbugs/issue52612.go
new file mode 100644
index 0000000..d8be049
--- /dev/null
+++ b/test/fixedbugs/issue52612.go
@@ -0,0 +1,49 @@
+// run
+
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "sync/atomic"
+ "unsafe"
+)
+
+var one interface{} = 1
+
+type eface struct {
+ typ unsafe.Pointer
+ data unsafe.Pointer
+}
+
+func f(c chan struct{}) {
+ var x atomic.Value
+
+ go func() {
+ x.Swap(one) // writing using the old marker
+ }()
+ for i := 0; i < 100000; i++ {
+ v := x.Load() // reading using the new marker
+
+ p := (*eface)(unsafe.Pointer(&v)).typ
+ if uintptr(p) == ^uintptr(0) {
+ // We read the old marker, which the new reader
+ // doesn't know is a case where it should retry
+ // instead of returning it.
+ panic("bad typ field")
+ }
+ }
+ c <- struct{}{}
+}
+
+func main() {
+ c := make(chan struct{}, 10)
+ for i := 0; i < 10; i++ {
+ go f(c)
+ }
+ for i := 0; i < 10; i++ {
+ <-c
+ }
+}
diff --git a/test/typeparam/issue52117.dir/a.go b/test/typeparam/issue52117.dir/a.go
new file mode 100644
index 0000000..e571ea9
--- /dev/null
+++ b/test/typeparam/issue52117.dir/a.go
@@ -0,0 +1,15 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+func Compare[T int | uint](a, b T) int {
+ return 0
+}
+
+type Slice[T int | uint] struct{}
+
+func (l Slice[T]) Comparator() func(v1, v2 T) int {
+ return Compare[T]
+}
diff --git a/test/typeparam/issue52117.dir/b.go b/test/typeparam/issue52117.dir/b.go
new file mode 100644
index 0000000..3d3bf4c
--- /dev/null
+++ b/test/typeparam/issue52117.dir/b.go
@@ -0,0 +1,7 @@
+package b
+
+import "./a"
+
+func Test() {
+ var _ a.Slice[uint]
+}
diff --git a/test/typeparam/issue52117.go b/test/typeparam/issue52117.go
new file mode 100644
index 0000000..8bb5c3e
--- /dev/null
+++ b/test/typeparam/issue52117.go
@@ -0,0 +1,7 @@
+// compiledir
+
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored