aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-10[release-branch.go1.18] go1.18.2go1.18.2Heschi Kreinick
Change-Id: I2f9a3e6819d10190117973262568aaacf47435e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/405477 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-05-10[release-branch.go1.18] go/types, types2: use a type lookup by identity in ↵Robert Findley
method lookup Named type identity is no longer canonical. For correctness, named types need to be compared with types.Identical. Our method set algorithm was not doing this: it was using a map to de-duplicate named types, relying on their pointer identity. As a result it was possible to get incorrect results or even infinite recursion, as encountered in #52715. To fix this, look up types by identity in NewMethodSet and LookupFieldOrMethod. This does a linear search among types with equal origin. Alternatively we could use a *Context to do a hash lookup, but in practice we will be considering a small number of types, and so performance is not a concern and a linear lookup is simpler. This also means we don't have to rely on our type hash being perfect, which we don't depend on elsewhere. Also add more tests for NewMethodSet and LookupFieldOrMethod involving generics. Fixes #52804 Change-Id: I04dfeff54347bc3544d95a30224c640ef448e9b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/404099 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Findley <rfindley@google.com> (cherry picked from commit f088f4962e628992833444df7486d392715ea73d) Reviewed-on: https://go-review.googlesource.com/c/go/+/405117 Reviewed-by: Alan Donovan <adonovan@google.com>
2022-05-09[release-branch.go1.18] net: skip TestDialCancel on darwin-arm64Heschi Kreinick
We're turning up Macs in a network environment that clashes with this test. I don't think it's critical to get it working, so skip it. For #49149. Fixes #52706. Change-Id: I925e3ecc5356c4cefd208bdcff3d98021215d0b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/402181 Reviewed-by: Alex Rakoczy <alex@golang.org> Run-TryBot: Heschi Kreinick <heschi@google.com> Auto-Submit: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 06b0a655a1f46abab2e3c173259ad184b557dd89) Reviewed-on: https://go-review.googlesource.com/c/go/+/405294 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-05-09[release-branch.go1.18] net/http/httptest: fix race in Server.CloseMaisem Ali
When run with race detector the test fails without the fix. For #51799 Fixes #51897 Change-Id: I273adb6d3a2b1e0d606b9c27ab4c6a9aa4aa8064 GitHub-Last-Rev: a5ddd146a2a65f2e817eed5133449c79b3af2562 GitHub-Pull-Request: golang/go#51805 Reviewed-on: https://go-review.googlesource.com/c/go/+/393974 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 1d19cea740a5a044848aaab3dc119f60c947be1d) Reviewed-on: https://go-review.googlesource.com/c/go/+/401317 Reviewed-by: David Chase <drchase@google.com>
2022-05-09[release-branch.go1.18] go/types: clarify that contexts do not guarantee ↵Robert Findley
deduplication Documentation around the use of types.Context is unclear about whether contexts guarantee deduplication of identical instances. Add explicit disclaimers that this is not the case. Fixes golang/go#52028 Change-Id: I6651587315d3cbf9e8d70a69d3e2ec5cedd00da5 Reviewed-on: https://go-review.googlesource.com/c/go/+/396536 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> (cherry picked from commit 83327b4ae41cf1ef17fb4df4dc395cf17efc6375) Reviewed-on: https://go-review.googlesource.com/c/go/+/397674 Reviewed-by: Russ Cox <rsc@golang.org>
2022-05-09[release-branch.go1.18] cmd/compile: always write fun[0] in incomplete itabKeith Randall
runtime.getitab need filled fun[0] to identify whether implemented the interface. Fixes #51738 Fixes #52244 Change-Id: I0173b98f4e1b45e3a0183a5b60229d289140d1e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/399058 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/399974 Reviewed-by: Austin Clements <austin@google.com>
2022-05-09[release-branch.go1.18] runtime: align m.procid to 8 bytes on 32-bit systemsMichael Pratt
https://go-review.googlesource.com/c/go/+/383434 started using atomic Load64 on this field, which breaks 32 bit platforms which require 64-bit alignment of uint64s that are passed to atomic operations. Not sure why this doesn't break everywhere, but I saw it break on my laptop during all.bash. For #51776. Fixes #52305. Change-Id: Ida27b23068b3cc7208fce3c97b69a464ccf68209 Reviewed-on: https://go-review.googlesource.com/c/go/+/399754 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> (cherry-picked from commit ea7e3e3c0f561d1115d647e3e24ca61d0382e1ac) Reviewed-on: https://go-review.googlesource.com/c/go/+/399954 Run-TryBot: Michael Pratt <mpratt@google.com>
2022-05-09[release-branch.go1.18] cmd/compile: disable rewrite loop detector for ↵Keith Randall
deadcode-only changes We're guaranteed we won't infinite loop on deadcode-only changes, because each change converts valid -> invalid, and there are only a finite number of valid values. The loops this test is looking for are those generated by rule applications, so it isn't useful to check for loops when rules aren't involved. Fixes #52366 Change-Id: Idf1abeab9d47baafddc3a1197d5064faaf07ef78 Reviewed-on: https://go-review.googlesource.com/c/go/+/392760 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> (cherry picked from commit 15728ce950eea43d6f1b9fb29819d006071e843a) Reviewed-on: https://go-review.googlesource.com/c/go/+/400514 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-05-09[release-branch.go1.18] reflect: ensure map keys match key type in MapIndex ↵Dan Kortschak
and SetMapIndex name old time/op new time/op delta Map/StringKeys/MapIndex-8 2.36µs ± 5% 2.55µs ±11% +7.98% (p=0.006 n=10+9) Map/StringKeys/SetMapIndex-8 4.86µs ± 7% 4.77µs ± 1% ~ (p=0.211 n=10+9) Map/StringKindKeys/MapIndex-8 2.29µs ± 3% 2.28µs ± 4% ~ (p=0.631 n=10+10) Map/StringKindKeys/SetMapIndex-8 4.44µs ± 3% 4.61µs ± 1% +3.78% (p=0.000 n=10+10) Map/Uint64Keys/MapIndex-8 3.42µs ± 9% 3.11µs ± 2% -9.20% (p=0.000 n=10+9) Map/Uint64Keys/SetMapIndex-8 5.17µs ± 3% 5.00µs ± 1% -3.23% (p=0.000 n=9+10) For #52379 Fixes #52386 Change-Id: I545c71ea3145280828ca4186aad036a6c02016ed Reviewed-on: https://go-review.googlesource.com/c/go/+/400635 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> (cherry picked from commit 11a650bb4aabfd7998b61df3ac33f61831d7abff) Reviewed-on: https://go-review.googlesource.com/c/go/+/404000 Reviewed-by: David Chase <drchase@google.com>
2022-05-09[release-branch.go1.18] syscall: check correct group in FaccessatDamien Neil
The Faccessat call checks the user, group, or other permission bits of a file to see if the calling process can access it. The test to see if the group permissions should be used was made with the wrong group id, using the process's group id rather than the file's group id. Fix this to use the correct group id. No test since we cannot easily change file permissions when not running as root and the test is meaningless if running as root. For #52313 Fixes #52440 Change-Id: I4e2c84754b0af7830b40fd15dedcbc58374d75ee Reviewed-on: https://go-review.googlesource.com/c/go/+/399539 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit f66925e854e71e0c54b581885380a490d7afa30c) Reviewed-on: https://go-review.googlesource.com/c/go/+/401079 Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Tatiana Bradley <tatiana@golang.org> Auto-Submit: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
2022-05-09[release-branch.go1.18] cmd/go: write changes to go.mod and go.sum after ↵Bryan C. Mills
loading the command-line-arguments package This entrypoint was missed in CL 349600, and the behavior happened not to be covered by existing tests. Updates #52331. Fixes #52468. Change-Id: Iccf12e8e633215abe4bfa1c3ca2fe3a8391b5ba5 Reviewed-on: https://go-review.googlesource.com/c/go/+/401536 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> (cherry picked from commit cf697253abb781e8a3e8825b7a4b5b96a534b907) Reviewed-on: https://go-review.googlesource.com/c/go/+/404094 Reviewed-by: David Chase <drchase@google.com>
2022-05-09[release-branch.go1.18] go/types,types2: delay the check for conflicting ↵Robert Findley
struct field names In #52529, we observed that checking types for duplicate fields and methods during method collection can result in incorrect early expansion of the base type. Fix this by delaying the check for duplicate fields. Notably, we can't delay the check for duplicate methods as we must preserve the invariant that added method names are unique. After this change, it may be possible in the presence of errors to have a type-checked type containing a method name that conflicts with a field name. With the previous logic conflicting methods would have been skipped. This is a change in behavior, but only for invalid code. Preserving the existing behavior would likely require delaying method collection, which could have more significant consequences. As a result of this change, the compiler test fixedbugs/issue28268.go started passing with types2, being previously marked as broken. The fix was not actually related to the duplicate method error, but rather the fact that we stopped reporting redundant errors on the calls to x.b() and x.E(), because they are now (valid!) methods. Updates #52529 Fixes #52558 Change-Id: I850ce85c6ba76d79544f46bfd3deb8538d8c7d00 Reviewed-on: https://go-review.googlesource.com/c/go/+/403455 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit b75e492b35746ca3b327f7b353f4912e705a3125) Reviewed-on: https://go-review.googlesource.com/c/go/+/403754
2022-05-09[release-branch.go1.18] cmd/compile: set correct package for ↵Cuong Manh Le
vars/params/results from nested instantiation Fixes #52606 Change-Id: Ib5b2cdbdbce1d516aa10a0df349449b756f2f404 Reviewed-on: https://go-review.googlesource.com/c/go/+/398474 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/403174
2022-05-09[release-branch.go1.18] sync/atomic: use consistent first-store-in-progress ↵Keith Randall
marker We need to use the same marker everywhere. My CL to rename the marker (CL 241661) and the CL to add more uses of the marker under the old name (CL 241678) weren't coordinated with each other. Fixes #52615 Change-Id: I97023c0769e518491924ef457fe03bf64a2cefa6 Reviewed-on: https://go-review.googlesource.com/c/go/+/403094 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/403198
2022-05-09[release-branch.go1.18] cmd/compile: use dictionary to convert type to ↵Keith Randall
shaped interface type When we convert a type to a shaped interface type, we are not able to recognize the itab. So passing the itab by dictionary as the workaround. Fixes #52691. Change-Id: I75c23c7dd215daf9761dc24116a8af2c28c6d948 Reviewed-on: https://go-review.googlesource.com/c/go/+/401034 Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/403934 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Keith Randall <khr@golang.org>
2022-05-09[release-branch.go1.18] runtime: support for debugger function calls on ↵eric fang
linux/arm64 This CL adds support for debugger function calls on linux arm64 platform. The protocol is basically the same as in CL 109699, except for the following differences: 1, The abi difference which affect parameter passing and frame layout. 2, Stores communication information in R20. 3, The closure register is R26. 4, Use BRK 0 instruction to generate a breakpoint. The saved PC in sigcontext is the PC where the signal occurred, not the next PC. In addition, this CL refactors the existing code (which is dedicated to amd64) for easier multi-arch scaling. Fixes #52699 Change-Id: I06b14e345cc89aab175f4a5f2287b765da85a86b Reviewed-on: https://go-review.googlesource.com/c/go/+/395754 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 9717e8f80f973e747a6c6e4a938c7f2a091a9b50) Reviewed-on: https://go-review.googlesource.com/c/go/+/404215 Reviewed-by: David Chase <drchase@google.com>
2022-05-06[release-branch.go1.18] runtime: don't block preemption signal in new M's or ↵Ian Lance Taylor
ensureSigM No test because we already have a test in the syscall package. The issue reports 1 failure per 100,000 iterations, which is rare enough that our builders won't catch the problem. For #52226 Fixes #52375 Change-Id: I17633ff6cf676b6d575356186dce42cdacad0746 Reviewed-on: https://go-review.googlesource.com/c/go/+/400315 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit e3982660a73b04a87c08215cb5aaa16d816ea573) Reviewed-on: https://go-review.googlesource.com/c/go/+/400318 Reviewed-by: Austin Clements <austin@google.com>
2022-05-04[release-branch.go1.18] syscall: relax output check in ↵Bryan C. Mills
TestGroupCleanupUserNamespace “If you have a procedure with ten parameters, you probably missed some.” ― attr. Alan J. Perlis I argue that the same is true for hard-coded special cases. In TestGroupCleanupUserNamespace, instead of a curated list of strings observed in the wild we now check for a prefix, as was done for TestGroupCleanup in CL 24670. Updates #52088. Fixes #52149. Change-Id: I59c5b0c048113e306996c0f8247e09c714d2423a Reviewed-on: https://go-review.googlesource.com/c/go/+/397316 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 434b2a5d0dbdfdce6327beb06ca03c02b3fd2785) Reviewed-on: https://go-review.googlesource.com/c/go/+/398234 Reviewed-by: Russ Cox <rsc@golang.org>
2022-05-04[release-branch.go1.18] crypto/x509: properly handle issuerUniqueID and ↵Roland Shoemaker
subjectUniqueID Updates #51754 Fixes #51859 Change-Id: I3bfa15db3497de9fb82d6391d87fca1ae9ba6543 Reviewed-on: https://go-review.googlesource.com/c/go/+/394297 Trust: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit 9a53b472b5ed41f9fe79a73f1236ed3f45f8871a) Reviewed-on: https://go-review.googlesource.com/c/go/+/399500 Reviewed-by: Russ Cox <rsc@golang.org>
2022-05-02[release-branch.go1.18] cmd/compile/internal/types2: use correct value of iotaRobert Griesemer
Fixes #52441. Change-Id: I5cbf8c448dba037e9e0c5fe8f209401d6bf7d43f Reviewed-on: https://go-review.googlesource.com/c/go/+/401134 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/401174 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
2022-04-20[release-branch.go1.18] cmd/go: allow '-buildvcs=auto' and treat it as the ↵Bryan C. Mills
default When we added VCS stamping in the Go 1.18 release, we defaulted to -buildvcs=true, on the theory that most folks will actually want VCS information stamped. We also made -buildvcs=true error out if a VCS directory is found and no VCS tool is available, on the theory that a user who builds with '-buildvcs=true' will be very surprised if the VCS metadata is silently missing. However, that causes a problem for CI environments that don't have the appropriate VCS tool installed. (And we know that's a common situation because we're in that situation ourselves — see #46693!) The new '-buildvcs=auto' setting provides a middle ground: it stamps VCS information by default when the tool is present (and reports explicit errors if the tool errors out), but omits the metadata when the tool isn't present at all. Updates #51748. Updates #51999. Fixes #51798. Change-Id: Iebc955c2af0abca9b7517f62ca48b1d944eb2df4 Reviewed-on: https://go-review.googlesource.com/c/go/+/398855 Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 4569fe64101c2209e3429bd1c953b5f4021fc43d) Reviewed-on: https://go-review.googlesource.com/c/go/+/400454 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-04-12[release-branch.go1.18] go1.18.1go1.18.1Dmitri Shuralyov
Change-Id: If2b91acf7fb4a55cded985d6f2a2ab058c1b7bd3 Reviewed-on: https://go-review.googlesource.com/c/go/+/399818 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-04-12[release-branch.go1.18] encoding/pem: fix stack overflow in DecodeJulie Qiu
Previously, Decode called decodeError, a recursive function that was prone to stack overflows when given a large PEM file containing errors. Credit to Juho Nurminen of Mattermost who reported the error. Fixes CVE-2022-24675 Updates #51853 Fixes #52037 Change-Id: Iffe768be53c8ddc0036fea0671d290f8f797692c Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1391157 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit 794ea5e828010e8b68493b2fc6d2963263195a02) Reviewed-on: https://go-review.googlesource.com/c/go/+/399817 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-06[release-branch.go1.18] go/types: don't report errors for untyped int shifts ↵Robert Findley
on Go < 1.13 CL 337529 introduced upfront type-checking of constant shift operands, to avoid converting their type to uint (per the spec). However, it had an oversight in that the checks intended for non-constant operands still ran after the explicit checking of constant operands. As a result, there are at least two bugs: - When GoVersion is < 1.13, we report spurious errors for untyped constant shift operands. - When the operand is an untyped float constant, we still convert to uint (this was a known bug reported in #47410). Looking at this now, it seems clear that we can avoid both of these bugs by simply not running the additional checks in the case of a constant operand. However, this should be considered with some care, as shifts are notoriously tricky. While cherry-picking, the new test file is updated to use the go1_12 package name, following our convention for specifying language version in the release branch. Fixes #52032 Change-Id: Ia489cc5470b92a8187d3de0423d05b309daf47bb Reviewed-on: https://go-review.googlesource.com/c/go/+/396775 Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 8a816d5efcc842ae92f0193aa9c1d433bd66ef31) Reviewed-on: https://go-review.googlesource.com/c/go/+/397680
2022-04-06[release-branch.go1.18] go/types, types2: fix overlap test for union termlistRobert Griesemer
Per the spec, "the type sets of all non-interface terms must be pairwise disjoint (the pairwise intersection of the type sets must be empty)" in a union. For the overlap test, the existing implementation casually mixed syntactic union terms (which may have interface type) with type set terms (which are normalized/expanded and must not have interface type). As a consequence, in some cases the overlap test failed. This change skips terms with interface types in the overlap test. For this cherry-pick, also rename the files ending in issue51607.go to issue51607.go2 because the 1.18 branch requires tests containing generic features to end in .go2. Fixes #52119. Change-Id: I8ae9953db31f0a0428389c6a45a6696aa2450219 Reviewed-on: https://go-review.googlesource.com/c/go/+/397695 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/398154
2022-04-06[release-branch.go1.18] crypto/elliptic: tolerate zero-padded scalars in ↵Filippo Valsorda
generic P-256 Updates #52075 Fixes #52077 Fixes CVE-2022-28327 Change-Id: I595a7514c9a0aa1b9c76aedfc2307e1124271f27 Reviewed-on: https://go-review.googlesource.com/c/go/+/397137 Trust: Filippo Valsorda <filippo@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
2022-04-05[release-branch.go1.18] cmd/go: prevent panic in go work useFilippo Rossi
Check if paths passed as arguments are existing directories. Fixes #52140 Updates #51841 Change-Id: Icfd148627e6f2c4651d6f923a37d413e68c67f6c GitHub-Last-Rev: 77fffa7635052f11dc93488ee23fd1c895284b4d GitHub-Pull-Request: golang/go#51845 Reviewed-on: https://go-review.googlesource.com/c/go/+/394154 Trust: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/397995 Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-04-05[release-branch.go1.18] crypto/x509: only disable SHA-1 verification for ↵Roland Shoemaker
certificates Disable SHA-1 signature verification in Certificate.CheckSignatureFrom, but not in Certificate.CheckSignature. This allows verification of OCSP responses and CRLs, which still use SHA-1 signatures, but not on certificates. Updates #41682 Fixes #51852 Change-Id: Ia705eb5052e6fc2724fed59248b1c4ef8af6c3fe Reviewed-on: https://go-review.googlesource.com/c/go/+/394294 Trust: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Jordan Liggitt <liggitt@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 35998c010947d3a5a26409fffcb4ed16c3595850) Reviewed-on: https://go-review.googlesource.com/c/go/+/398074 Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-04-05[release-branch.go1.18] cmd/go: prevent go work use panic when given a fileJohn Anthony
The current implementation fails to identify that an argument to go work use is a file when expecting a directory, and panics when attempting to access it as a directory. This change checks arguments are directories and generates an error otherwise. Fixes #51764 Updates #51749 Change-Id: If8f69d233409e93fcf391a8774bace74c031c986 Reviewed-on: https://go-review.googlesource.com/c/go/+/393615 Reviewed-by: Bryan Mills <bcmills@google.com> Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Ian Lance Taylor <iant@golang.org> (cherry picked from commit a84ef500213ef6c2a0e4bfd82253e9fcd28f1f62) Reviewed-on: https://go-review.googlesource.com/c/go/+/397994 Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-04-04[release-branch.go1.18] crypto/x509: fix Certificate.Verify crashBrad Fitzpatrick
(Primarily from Josh) Updates #51759 Fixes #51763 Fixes CVE-2022-27536 Co-authored-by: Josh Bleecher Snyder <josharian@gmail.com> Change-Id: I0a6f2623b57750abd13d5e194b5c6ffa3be6bf72 Reviewed-on: https://go-review.googlesource.com/c/go/+/393655 Trust: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 0fca8a8f25cf4636fd980e72ba0bded4230922de) Reviewed-on: https://go-review.googlesource.com/c/go/+/394655 Trust: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
2022-04-04[release-branch.go1.18] go/types, types2: preserve parent scope when ↵Robert Findley
substituting receivers For #51920 Fixes #52007 Change-Id: I29e44a52dabee5c09e1761f9ec8fb2e8795f8901 Reviewed-on: https://go-review.googlesource.com/c/go/+/395538 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 9b90838712856cad86504a526e566f963f86c04e) Reviewed-on: https://go-review.googlesource.com/c/go/+/395680
2022-04-04[release-branch.go1.18] runtime: make static/dynamic startup detection work ↵Paul E. Murphy
with musl on ppc64le The glibc loader explicitly sets the first doubleword on the stack (R1) to $0 to indicate it was dynamically loaded. An ELFv2 ABI compliant loader will set R3/R4 to argc/argv when starting the process, and R13 to TLS. musl is not compliant. Instead it passes argc/argv like the kernel, but R3/R4 are in an undefined state and R13 is valid. With the knowledge above, the startup code can be modified to dynamically handle all three cases when linked internally. Fixes #51874 Change-Id: I5de33862c161900d9161817388bbc13a65fdc69c Reviewed-on: https://go-review.googlesource.com/c/go/+/394654 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Paul Murphy <murp@ibm.com> Trust: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/394794 Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2022-04-04[release-branch.go1.18] cmd/compile: replace Type.OrigSym with Type.OrigTypeMatthew Dempsky
First law of cmd/compile frontend development: thou shalt not rely on types.Sym. This CL replaces Type.OrigSym with Type.OrigType, which semantically matches what all of the uses within the frontend actually care about, and avoids using types.Sym, which invariably leads to mistakes because symbol scoping in the frontend doesn't work how anyone intuitively expects it to. Fixes #51855. Change-Id: I4affe6ee0718103ce5006ab68aa7e1bb0cac6881 Reviewed-on: https://go-review.googlesource.com/c/go/+/394274 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit adae6ec542c3287ffe643093a0f61c9871f4e238) Reviewed-on: https://go-review.googlesource.com/c/go/+/394296
2022-04-04[release-branch.go1.18] all update vendored golang.org/x/toolsRobert Findley
Update x/tools from internal-branch.go1.18-vendor to pick up the cherry-picked fix for #51727. The following commands were used, from the cmd module: go get -d golang.org/x/tools@internal-branch.go1.18-vendor go mod tidy go mod vendor Fixes #51727 Change-Id: I380a66fee585c8c12f9646de87ffb5e398b4ba80 Reviewed-on: https://go-review.googlesource.com/c/go/+/397476 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-04-04[release-branch.go1.18] cmd/compile/internal/importer: key tparams by ↵Robert Findley
Package instead of pkgname The importer type param index used package name as type parameter key, causing type parameters to be reused/overwritten if two packages in the import graph had the same combination of (package name, declaration name, type parameter name). Fix this by instead using the *Package in the key. Note: -G=3 was added to typeparam/issue51836.go, as it is necessary for 1.18 but not for tip. For #51836 Fixes #51847 Change-Id: I881ceaf3cf7c1ab4e0835962350feb552e79b233 Reviewed-on: https://go-review.googlesource.com/c/go/+/394219 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> (cherry picked from commit fd1b5904ae7cc76eefd94d315f92265da5b81b14) Reviewed-on: https://go-review.googlesource.com/c/go/+/394854
2022-04-04[release-branch.go1.18] cmd/compile: fix panic with nested dead hidden closuresCuong Manh Le
CL 342350 fixed deadcode panic with dead hidden closures. However, a closure may contains nested dead hidden closures, so we need to mark them dead as well. Fixes #51846 Change-Id: Ib54581adfc1bdea60e74d733cd30fd8e783da983 Reviewed-on: https://go-review.googlesource.com/c/go/+/394079 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/394080 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-04-04[release-branch.go1.18] cmd/go: avoid stamping VCS metadata in test binariesBryan C. Mills
Invoking a VCS tool requires that the VCS tool be installed, and also adds latency to build commands. Unfortunately, we had been mistakenly loading VCS metadata for tests of "main" packages. Users almost never care about versioning for test binaries, because 'go test' runs the test in the source tree and test binaries are only rarely used outside of 'go test'. So the user already knows exactly which version the test is built against, because the source code is right there — it's not worth the overhead to stamp. Fixes #51767. Updates #51723. Change-Id: I96f191c5a765f5183e5e10b6dfb75a0381c99814 Reviewed-on: https://go-review.googlesource.com/c/go/+/393894 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Trust: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 67f6b8c98715f265f38aff4052356ef6e6b35dfe) Reviewed-on: https://go-review.googlesource.com/c/go/+/393878 Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-04-04[release-branch.go1.18] cmd/compile: pointers to notinheap types need their ↵Keith Randall
own shape They should not share a shape with regular pointers. We could coalesce multiple pointer-to-not-in-heap types, but doesn't seem worth it - just make them fully stenciled. Fixes #51741 Change-Id: Ie8158177226fbc46a798e71c51897a82f15153df Reviewed-on: https://go-review.googlesource.com/c/go/+/393895 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit fcf6afb82dc1e9f80a6260467026adc11d5c9529) Reviewed-on: https://go-review.googlesource.com/c/go/+/393935
2022-04-04[release-branch.go1.18] cmd/link: mark unexported methods for pluginsCherry Mui
When plugin is used, we already mark all exported methods reachable. However, when the plugin and the host program share a common package, an unexported method could also be reachable from both the plugin and the host via interfaces. We need to mark them as well. Fixes #51737. Updates #51621. Change-Id: I1a70d3f96b66b803f2d0ab14d00ed0df276ea500 Reviewed-on: https://go-review.googlesource.com/c/go/+/393365 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> (cherry picked from commit 91631bc7e0131367eb051b581cf34573399ac592) Reviewed-on: https://go-review.googlesource.com/c/go/+/397483
2022-04-04[release-branch.go1.18] cmd/compile: fix wrong dict param when getting dict typeCuong Manh Le
CL 338129 added getDictionaryType to get the dictionary type from the specified dict param, but still using the one in info.dictParam, which is wrong. Fixes #51669 Change-Id: Ie13460c1e5751c4c5fc44479a44f6eed8b3b06e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/391994 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/392614
2022-04-04[release-branch.go1.18] go/types, types2: use correct underlying type in ↵Robert Griesemer
union set computation Fixes #51665. Change-Id: Ibf415d7e12849b8f50b58d74713613d4e65bc347 Reviewed-on: https://go-review.googlesource.com/c/go/+/392575 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/392577 TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-01[release-branch.go1.18] crypto/x509: skip WSATRY_AGAIN errors when dialing ↵Bryan C. Mills
badssl.com subdomains (Temporarily, until the root cause of the test failure can be diagnosed and fixed properly.) For #52094 Change-Id: Iec69e162159f3f0a93135f742aac97cf82c1d96c Reviewed-on: https://go-review.googlesource.com/c/go/+/397478 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit df89f2ba53aab53356be197c581d142cefc2c6bc) Reviewed-on: https://go-review.googlesource.com/c/go/+/397594 Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-03-30[release-branch.go1.18] bytes: restore old Trim/TrimLeft behavior for nilIan Lance Taylor
Keep returning nil for the cases where we historically returned nil, even though this is slightly different for TrimLeft and TrimRight. For #51793 Fixes #51796 Change-Id: Ifbdfc6b09d52b8e063cfe6341019f9b2eb8b70e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/393876 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 32fdad19a246143ae4f194d1b39886d778de1380) Reviewed-on: https://go-review.googlesource.com/c/go/+/396294 Reviewed-by: Austin Clements <austin@google.com>
2022-03-28[release-branch.go1.18] runtime: call testenv.MustHaveCGO in a couple of testsIan Lance Taylor
For #51695 Fixes #51697 Change-Id: Icfe9d26ecc28a7db9040d50d4661cf9e8245471e Reviewed-on: https://go-review.googlesource.com/c/go/+/392916 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 2d32594396b231b39d09ec21d34b22b0270268b5) Reviewed-on: https://go-review.googlesource.com/c/go/+/393699 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-03-15[release-branch.go1.18] go1.18go1.18Heschi Kreinick
Change-Id: I81d8267b73c3dbd0d2f76e8c80fa2ae8b6f386df Reviewed-on: https://go-review.googlesource.com/c/go/+/392894 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-03-14[release-branch.go1.18] doc: update go_spec.html with latest changesDmitri Shuralyov
Generated at 2022-03-14 14:50 (EDT) with: git fetch git checkout origin/master -- doc/go_spec.html This includes spec changes up to CL 391754. Fixes #51532. Change-Id: I2c23d764ffa33f24647cd2a4060268c1500f6f99 Reviewed-on: https://go-review.googlesource.com/c/go/+/392674 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-03-14[release-branch.go1.18] cmd/compile: fix re-export closureCuong Manh Le
For hidden closure built during stenciling to implement a function instantiation, the function may come from other package, not local package, which causes the ICE for code that re-export the hidden closure after inlining. To fix it, use the closure package for export writer when writing out the closure itself. Fixes #51423 Change-Id: I23b067ba14e2d602a0fc3b2e99bd9317afbe53ff Reviewed-on: https://go-review.googlesource.com/c/go/+/391574 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 9743e9b6d8e150639f509fc64e4bc5f24ecce562) Reviewed-on: https://go-review.googlesource.com/c/go/+/391774 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-14[release-branch.go1.18] internal/fuzz: minimization should not reduce coverageSteven Johnstone
Minimization should result in a fuzz input which includes the same coverage bits as the original input. Updates #48326 Change-Id: I6c5f30058b57ccd1a096ad0e9452a4dfbb7d9aab Reviewed-on: https://go-review.googlesource.com/c/go/+/391454 Trust: Bryan Mills <bcmills@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 5003ed884a67ee26b4cedbe6f5b1c02bd5eb6630) Reviewed-on: https://go-review.googlesource.com/c/go/+/391798 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-03-14[release-branch.go1.18] internal/fuzz: don't use dirty coverage maps during ↵Roland Shoemaker
minimization When minimizing a value, if the value cannot be minimized (i.e. it is the final value is the same value as was sent for minimization) return the initial coverage map, rather than the coverageSnapshot, which is actually the coverage map for the final minimization step and may not accurately reflect whether the input actually expands the coverage set or not. Updates #48326 Change-Id: I01f0eebe5841e808b6799647d2e5fe3aa45cd2e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/391614 Reviewed-by: Bryan Mills <bcmills@google.com> Trust: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit bd71dee2b4c0a44f9c32e9eb23d990b54ce06bae) Reviewed-on: https://go-review.googlesource.com/c/go/+/391797 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2022-03-14[release-branch.go1.18] go/types, types2: remove incorrect assertion (don't ↵Robert Griesemer
crash) The removed assertion was never incorrect, as signatures may be from methods in interfaces, and (some) interfaces set the receivers of their methods (so we have a position for error reporting). This CL changes the issue below from a release blocker to an issue for Go 1.19. For #51593. Change-Id: I0c5f2913b397b9ab557ed74a80cc7a715e840412 Reviewed-on: https://go-review.googlesource.com/c/go/+/391615 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 914195c132cbec651aa43c409e8aac2614b53b38) Reviewed-on: https://go-review.googlesource.com/c/go/+/391796 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>