aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-04-11[release-branch.go1.12] go1.12.4go1.12.4Andrew Bonventre
Change-Id: I4d1b5e00ab4480b4c5adeeb4f53ddfdfa3903b71 Reviewed-on: https://go-review.googlesource.com/c/go/+/171838 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-11[release-branch.go1.12] doc: document Go 1.12.4 and Go 1.11.9Brad Fitzpatrick
Updates #31293 Change-Id: I3d72f732be7b28059310ea6fc134c3bfac81492d Reviewed-on: https://go-review.googlesource.com/c/go/+/171578 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> (cherry picked from commit ab2a0803383f0f019db0b2252095f2fdb7735cea) Reviewed-on: https://go-review.googlesource.com/c/go/+/171766 Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-04-08[release-branch.go1.12] go1.12.3go1.12.3Andrew Bonventre
Change-Id: Iab946b7c903e3c30addc388900421a7ceb803f1c Reviewed-on: https://go-review.googlesource.com/c/go/+/171149 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-08[release-branch.go1.12] doc: correct link in 1.11.8 notesAndrew Bonventre
Change-Id: I09e0c2720ec0a51dc73c24b4550a749448656025 Reviewed-on: https://go-review.googlesource.com/c/go/+/171143 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 6f512c8d6696b288372c48c19058bbe9dcb79da0) Reviewed-on: https://go-review.googlesource.com/c/go/+/171157 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-08[release-branch.go1.12] doc: correct link in 1.12.3 notesAndrew Bonventre
Change-Id: I6dd60ea7b8a8756be97503e163c2386af16e4e12 Reviewed-on: https://go-review.googlesource.com/c/go/+/171144 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 973c0312e36fd56b6b2111a07a19de63e0dcbf03) Reviewed-on: https://go-review.googlesource.com/c/go/+/171147 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-08[release-branch.go1.12] doc: document Go 1.11.8Andrew Bonventre
Change-Id: Ia06f7005f466e55a22c76bf2b47d74ee8eb77dd1 Reviewed-on: https://go-review.googlesource.com/c/go/+/171139 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 739a78f2b8de3139ec253719d0a688c08b8e5324) Reviewed-on: https://go-review.googlesource.com/c/go/+/171145 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-08[release-branch.go1.12] doc: document Go 1.12.3Andrew Bonventre
Change-Id: I84c9a8ddbd3101dd478e4a8a4e191863e68c6af6 Reviewed-on: https://go-review.googlesource.com/c/go/+/171140 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 8759b4d3843494b60dd9d58458b4f2774baf5fcb) Reviewed-on: https://go-review.googlesource.com/c/go/+/171141
2019-04-05[release-branch.go1.12] go1.12.2go1.12.2Andrew Bonventre
Change-Id: I07e4404196886b7754414726f25092cca39861a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/170888 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-05[release-branch.go1.12] cmd/go: avoid link error when -coverpkg covers main ↵Jay Conrod
packages (more) This fixes two problems missed in CL 164877. First, p.Internal.BuildInfo is now part of the cache key. This is important since p.Internal.BuildInfo causes the build action to synthesize a new source file, which affects the output. Second, recompileForTest is always called for test packages. Previously, it was only called when there were internal test sources, so the fix in CL 164877 did not apply to packages that only had external tests. Fixes #30937 Change-Id: Iac2d7e8914f0313f9ab4222299a866f67889eb2e Reviewed-on: https://go-review.googlesource.com/c/go/+/168200 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit d34548e0b6acc14a99bc6ffc225eedbb56e03d60) Reviewed-on: https://go-review.googlesource.com/c/go/+/168717 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-05[release-branch.go1.12] runtime: fix write barrier on wasmAustin Clements
The current wasm write barrier implementation incorrectly implements the "deletion" part of the barrier. It correctly greys the new value of the pointer, but rather than also greying the old value of the pointer, it greys the object containing the slot (which, since the old value was just overwritten, is not going to contain the old value). This can lead to unmarked, reachable objects. Often, this is masked by other marking activity, but one specific sequence that can lead to an unmarked object because of this bug is: 1. Initially, GC is off, object A is reachable from just one pointer in the heap. 2. GC starts and scans the stack of goroutine G. 3. G copies the pointer to A on to its stack and overwrites the pointer to A in the heap. (Now A is reachable only from G's stack.) 4. GC finishes while A is still reachable from G's stack. With a functioning deletion barrier, step 3 causes A to be greyed. Without a functioning deletion barrier, nothing causes A to be greyed, so A will be freed even though it's still reachable from G's stack. This CL fixes the wasm write barrier. Fixes #30873. Change-Id: I8a74ee517facd3aa9ad606e5424bcf8f0d78e754 Reviewed-on: https://go-review.googlesource.com/c/go/+/167743 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit d9db9e32e924a60bbfbb15cc0dd7cfaaf8a62a3b) Reviewed-on: https://go-review.googlesource.com/c/go/+/167745 Reviewed-by: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-05[release-branch.go1.12] doc: document Go 1.12.2Andrew Bonventre
Change-Id: I990c451ff24844b39dee2477cec4caa9db2e8ebb Reviewed-on: https://go-review.googlesource.com/c/go/+/170883 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 5ec938cdcf7ab59f6d397cb3fa4d17459057ef61) Reviewed-on: https://go-review.googlesource.com/c/go/+/170885 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-05[release-branch.go1.12] doc: document Go 1.11.7Andrew Bonventre
Change-Id: Iec5e69b3ea163f42234d3b73696427a7aa8732e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/170884 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit e47ced78578c471cbcd34a7d6b223a71e84a46c8) Reviewed-on: https://go-review.googlesource.com/c/go/+/170886 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-04-05Revert "[release-branch.go1.12] syscall: avoid _getdirentries64 on darwin"Keith Randall
This reverts commit 731ebf4d87dbe349e2eb60233c3965ee62a32690. Reason for revert: It's not working for large directories. Change-Id: Ie0f88e0ed1d36c4ea4f32d2acd4e223bd8229ca0 Reviewed-on: https://go-review.googlesource.com/c/go/+/170882 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org>
2019-04-05[release-branch.go1.12] syscall: avoid _getdirentries64 on darwinKeith Randall
Getdirentries is implemented with the __getdirentries64 function in libSystem.dylib. That function works, but it's on Apple's can't-be-used-in-an-app-store-application list. Implement Getdirentries using the underlying fdopendir/readdir_r/closedir. The simulation isn't faithful, and could be slow, but it should handle common cases. Don't use Getdirentries in the stdlib, use fdopendir/readdir_r/closedir instead (via (*os.File).readdirnames). (Incorporates CL 170837 and CL 170698, which were small fixes to the original tip CL.) Fixes #31244 Update #28984 RELNOTE=yes Change-Id: Ia6b5d003e5bfe43ba54b1e1d9cfa792cc6511717 Reviewed-on: https://go-review.googlesource.com/c/go/+/168479 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 9da6530faab0a58c4c4e02b2f3f4a5c754dcbd4e) Reviewed-on: https://go-review.googlesource.com/c/go/+/170640 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-05[release-branch.go1.12] runtime: skip broken TestLldbPythonBrad Fitzpatrick
It's broken on our builders (once we enabled dev mode on our Macs, see CL 170339) Updates #31188 Change-Id: Iceea65dc79576057b401a461bfe39254fed1f7ed Reviewed-on: https://go-review.googlesource.com/c/go/+/170281 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 46c3e217188043c7cea9e181f0d61825d2636ad7) Reviewed-on: https://go-review.googlesource.com/c/go/+/170798 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2019-04-04[release-branch.go1.12] internal/poll: fix deadlock in Write if len(buf) > maxRWIan Lance Taylor
fd.l.Lock shouldn't be called in a loop. Manual backport of CL 165598. It could not be cherry-picked due to conflicts. Fixes #31211 Change-Id: Ib76e679f6a276b32fe9c1594b7e9a506017a7967 Reviewed-on: https://go-review.googlesource.com/c/go/+/170680 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-02[release-branch.go1.12] cmd/compile: fix literal struct interface {} lost ↵LE Manh Cuong
passing by value CL 135377 introduces pass strings and slices to convT2{E,I} by value. Before that CL, all types, except interface will be allocated temporary address. The CL changes the logic that only constant and type which needs address (determine by convFuncName) will be allocated. It fails to cover the case where type is static composite literal. Adding condition to check that case fixes the issue. Also, static composite literal node implies constant type, so consttype checking can be removed. Fixes #31209 Change-Id: Ifc750a029fb4889c2d06e73e44bf85e6ef4ce881 Reviewed-on: https://go-review.googlesource.com/c/go/+/168858 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit d47db6dc0ce72d1371c81a677b45d7bdba39ff46) Reviewed-on: https://go-review.googlesource.com/c/go/+/170437 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-04-02[release-branch.go1.12] net: use network and host as singleflight key during ↵Cezar Sa Espinola
lookupIP In CL 120215 the cgo resolver was changed to have different logic based on the network being queried. However, the singleflight cache key wasn't updated to also include the network. This way it was possible for concurrent queries to return the result for the wrong network. This CL changes the key to include both network and host, fixing the problem. Fixes #31062 Change-Id: I8b41b0ce1d9a02d18876c43e347654312eba22fc Reviewed-on: https://go-review.googlesource.com/c/go/+/166037 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit e341bae08d75611adea6566c1d01c1e3a0de57f9) Reviewed-on: https://go-review.googlesource.com/c/go/+/170320 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-02[release-branch.go1.12] cmd/compile: copy volatile values before emitting ↵Cherry Zhang
write barrier call It is possible that a "volatile" value (one that can be clobbered by preparing args of a call) to be used in multiple write barrier calls. We used to copy the volatile value right before each call. But this doesn't work if the value is used the second time, after the first call where it is already clobbered. Copy it before emitting any call. Updates #30977. Fixes #30996. Change-Id: Iedcc91ad848d5ded547bf37a8359c125d32e994c Reviewed-on: https://go-review.googlesource.com/c/go/+/168677 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit f23c601bf9f66ef4a0d9d2dcd003b95e78fb28f8) Reviewed-on: https://go-review.googlesource.com/c/go/+/168817 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-02[release-branch.go1.12] net/http/httputil: make ReverseProxy flush headers ↵Jordan Liggitt
on FlushInterval A regression was introduced in CL 137335 (5440bfc) that caused FlushInterval to not be honored until the first Write() call was encountered. This change starts the flush timer as part of setting up the maxLatencyWriter. Fixes #31144 Change-Id: I75325bd926652922219bd1457b2b00ac6d0d41b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/170066 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 2cc347382f4df3fb40d8d81ec9331f0748b1c394) Reviewed-on: https://go-review.googlesource.com/c/go/+/170137
2019-03-27[release-branch.go1.12] cmd/go: fix the default build output name for ↵Dmitri Shuralyov
versioned binaries This change is a re-apply of the reverted CL 140863 with changes to address issue #30821. Specifically, path.Split continues to be used to split the '/'-separated import path, rather than filepath.Split. Document the algorithm for how the default executable name is determined in DefaultExecName. Rename a variable returned from os.Stat from bs to fi for consistency. CL 140863 factored out the logic to determine the default executable name from the Package.load method into a DefaultExecName function, and started using it in more places to avoid having to re-implement the logic everywhere it's needed. Most previous callers already computed the default executable name based on the import path. The load.Package method, before CL 140863, was the exception, in that it used the p.Dir value in GOPATH mode instead. There was a NOTE(rsc) comment that it should be equivalent to use import path, but it was too late in Go 1.11 cycle to risk implementing that change. This is part 1, a more conservative change for backporting to Go 1.12.2, and it keeps the original behavior of splitting on p.Dir in GOPATH mode. Part 2 will address the NOTE(rsc) comment and modify behavior in Package.load to always use DefaultExecName which splits the import path rather than directory. It is intended to be included in Go 1.13. Updates #27283 Updates #26869 Updates #30821 Fixes #30266 Change-Id: Ib1ebb95acba7c85c24e3a55c40cdf48405af34f3 Reviewed-on: https://go-review.googlesource.com/c/go/+/167503 Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> (cherry picked from commit 94563de87fad642677ffc62a4a82766597e39123) Reviewed-on: https://go-review.googlesource.com/c/go/+/168958 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-27[release-branch.go1.12] net: fix test after 8.8.8.8 changed its reverse DNS nameBrad Fitzpatrick
Google's 8.8.8.8 DNS server used to reports its reverse DNS name as ending in ".google.com". Now it's "dns.google.". Change-Id: I7dd15f03239e5c3f202e471618ab867690cb4f9d Reviewed-on: https://go-review.googlesource.com/c/go/+/169679 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> (cherry picked from commit 3089d189569ed272eaf2bc6c4330e848a46e9999) Reviewed-on: https://go-review.googlesource.com/c/go/+/169717
2019-03-27[release-branch.go1.12] cmd/compile: better handling for PAUTOHEAP in DWARF ↵Than McIntosh
inline gen When generating DWARF inline info records, the post-SSA code looks through the original "pre-inline" dcl list for the function so as to handle situations where formal params are promoted or optimized away. This code was not properly handling the case where an output parameter was promoted to the heap -- in this case the param node is converted in place from class PPARAMOUT to class PAUTOHEAP. This caused inconsistencies later on, since the variable entry in the abstract subprogram DIE wound up as a local and not an output parameter. Updates #30908. Fixes #31028. Change-Id: Ia70b89f0cf7f9b16246d95df17ad6e307228b8c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/168818 Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 68a98d52794fc324841f62732411f6bba23fc62c) Reviewed-on: https://go-review.googlesource.com/c/go/+/169417 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-24[release-branch.go1.12] runtime: safely load DLLsJason A. Donenfeld
While many other call sites have been moved to using the proper higher-level system loading, these areas were left out. This prevents DLL directory injection attacks. This includes both the runtime load calls (using LoadLibrary prior) and the implicitly linked ones via cgo_import_dynamic, which we move to our LoadLibraryEx. The goal is to only loosely load kernel32.dll and strictly load all others. Meanwhile we make sure that we never fallback to insecure loading on older or unpatched systems. This is CVE-2019-9634. Fixes #30666 Updates #14959 Updates #28978 Updates #30642 Change-Id: I401a13ed8db248ab1bb5039bf2d31915cac72b93 Reviewed-on: https://go-review.googlesource.com/c/go/+/165798 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> (cherry picked from commit 9b6e9f0c8c66355c0f0575d808b32f52c8c6d21c) Reviewed-on: https://go-review.googlesource.com/c/go/+/168339 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-03-15[release-branch.go1.12] os: consistently return PathError from RemoveAllBaokun Lee
Fixes #30859 Updates #30491 Change-Id: If4070e5d39d8649643d7e90f6f3eb499642e25ab Reviewed-on: https://go-review.googlesource.com/c/go/+/164720 Run-TryBot: Baokun Lee <nototon@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> (cherry picked from commit d039e12b54a73796caa913994597a9f3a73e8e87) Reviewed-on: https://go-review.googlesource.com/c/go/+/167739 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Baokun Lee <nototon@gmail.com>
2019-03-14[release-branch.go1.12] doc: add minor revisions header for 1.12Andrew Bonventre
Change-Id: I0d4a55af0bee754ab1ee817780027e9f72475afb Reviewed-on: https://go-review.googlesource.com/c/go/+/167712 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-03-14[release-branch.go1.12] go1.12.1go1.12.1Andrew Bonventre
Change-Id: Id5f76204b8cd3fe67c21c5adfd3a4e456a8cad14 Reviewed-on: https://go-review.googlesource.com/c/go/+/167704 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-14[release-branch.go1.12] doc: document Go 1.12.1Andrew Bonventre
Change-Id: I6d3a615c5f72e9aa29d23e127af98d6e836da173 Reviewed-on: https://go-review.googlesource.com/c/go/+/167699 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit f832a97e454a5e2bed336321965fd2382b2af868) Reviewed-on: https://go-review.googlesource.com/c/go/+/167702 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-03-14[release-branch.go1.12] doc: document Go 1.11.6Andrew Bonventre
Change-Id: I99832fa4f2c3ec28e2dad46cf7607f3766948031 Reviewed-on: https://go-review.googlesource.com/c/go/+/167698 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit d3bb45d9046bb7d12c4fc9cdaf122f36d001fd31) Reviewed-on: https://go-review.googlesource.com/c/go/+/167701
2019-03-14Revert "[release-branch.go1.12] cmd/go: fix the default build output name ↵Bryan C. Mills
for versioned binaries" This reverts commit 746edd459d26f07f69fcb6bddfafaaae7c5a2911 (CL 167384). Reason for revert: Dmitri identified a potential problem in https://go-review.googlesource.com/c/go/+/140863/11#message-db0ff6bb2c7b06161ca47de771c4465afa8b1102, and we'd like more time to investigate without holding up the 1.12 release branch. Updates #27283 Updates #30266 Updates #30821 Change-Id: I49d7bbbe200e80b81899c3bcbf7844717af010aa Reviewed-on: https://go-review.googlesource.com/c/go/+/167617 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-03-13[release-branch.go1.12] cmd/cgo: use explicit type for arg with bad pointer ↵Ian Lance Taylor
typedef Fixes #30816 Updates #30646 Change-Id: I5b7e986b0588e87b9781cce01445e3c55c06b6fc Reviewed-on: https://go-review.googlesource.com/c/go/+/165897 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit a6436a5655f56bb904871fece7db43a3ad3bf415) Reviewed-on: https://go-review.googlesource.com/c/go/+/167497 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-13[release-branch.go1.12] cmd/go: fix the default build output name for ↵Hana Kim
versioned binaries `go build` has chosen the last element of the package import path as the default output name when -o option is given. That caused the output of a package build when the module root is the major version component such as 'v2'. A similar issue involving `go install` was fixed in https://golang.org/cl/128900. This CL refactors the logic added with the change and makes it available as internal/load.DefaultExecName. This CL makes 'go test' to choose the right default test binary name when the tested package is in the module root. (E.g., instead of v2.test, choose pkg.test for the test of 'path/pkg/v2') Fixes #27283 Fixes #30266 Change-Id: I6905754f0906db46e3ce069552715f45356913ae Reviewed-on: https://go-review.googlesource.com/c/go/+/140863 Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit bf94fc3ae387fc09929443393741919fac6727af) Reviewed-on: https://go-review.googlesource.com/c/go/+/167384 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-13[release-branch.go1.12] text/template: error on method calls on nil interfacesDaniel Martí
Trying to call a method on a nil interface is a panic in Go. For example: var stringer fmt.Stringer println(stringer.String()) // nil pointer dereference In https://golang.org/cl/143097 we started recovering panics encountered during function and method calls. However, we didn't handle this case, as text/template panics before evalCall is ever run. In particular, reflect's MethodByName will panic if the receiver is of interface kind and nil: panic: reflect: Method on nil interface value Simply add a check for that edge case, and have Template.Execute return a helpful error. Note that Execute shouldn't just error if the interface contains a typed nil, since we're able to find a method to call in that case. Finally, add regression tests for both the nil and typed nil interface cases. Fixes #30464. Change-Id: Iffb21b40e14ba5fea0fcdd179cd80d1f23cabbab Reviewed-on: https://go-review.googlesource.com/c/161761 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> (cherry picked from commit 15b4c71a912846530315c3e854feaaa9d0d54220) Reviewed-on: https://go-review.googlesource.com/c/go/+/164457 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-13[release-branch.go1.12] cmd/compile: make KeepAlive work on stack objectCherry Zhang
Currently, runtime.KeepAlive applied on a stack object doesn't actually keeps the stack object alive, and the heap object referenced from it could be collected. This is because the address of the stack object is rematerializeable, and we just ignored KeepAlive on rematerializeable values. This CL fixes it. Updates #30476. Fixes #30478. Change-Id: Ic1f75ee54ed94ea79bd46a8ddcd9e81d01556d1d Reviewed-on: https://go-review.googlesource.com/c/164537 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 40df9cc6062492cd323f2251dd1583d200d1207e) Reviewed-on: https://go-review.googlesource.com/c/go/+/164627
2019-03-13[release-branch.go1.12] cmd/cgo: simplify and fix handling of untyped constantsRémy Oudompheng
Instead of trying to guess type of constants in the AST, which is hard, use the "var cgo%d Type = Constant" so that typechecking is left to the Go compiler. The previous code could still fail in some cases for constants imported from other modules or defined in other, non-cgo files. Fixes #30527 Change-Id: I2120cd90e90a74b9d765eeec53f6a3d2cfc1b642 Reviewed-on: https://go-review.googlesource.com/c/go/+/164897 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 711ea1e716b0c620cd9bcdd405eccae230d6dcbb) Reviewed-on: https://go-review.googlesource.com/c/go/+/165748 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-13[release-branch.go1.12] fmtsort: sort interfaces deterministicallylukechampine
Previously, the result of sorting a map[interface{}] containing multiple concrete types was non-deterministic. To ensure consistent results, sort first by type name, then by concrete value. Fixes #30484 Change-Id: I10fd4b6a74eefbc87136853af6b2e689bc76ae9d GitHub-Last-Rev: 1b07f0c275716e1b2834f74f9c67f897bae82882 GitHub-Pull-Request: golang/go#30406 Reviewed-on: https://go-review.googlesource.com/c/163745 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 9d40fadb1c3245a318b155ee3e19a4de139401dc) Reviewed-on: https://go-review.googlesource.com/c/go/+/164617 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-13[release-branch.go1.12] cmd/compile: fix ordering for short-circuiting opsKeith Randall
Make sure the side effects inside short-circuited operations (&& and ||) happen correctly. Before this CL, we attached the side effects to the node itself using exprInPlace. That caused other side effects in sibling expressions to get reordered with respect to the short circuit side effect. Instead, rewrite a && b like: r := a if r { r = b } That code we can keep correctly ordered with respect to other side-effects extracted from part of a big expression. exprInPlace seems generally unsafe. But this was the only case where exprInPlace is called not at the top level of an expression, so I don't think the other uses can actually trigger an issue (there can't be a sibling expression). TODO: maybe those cases don't need "in place", and we can retire that function generally. This CL needed a small tweak to the SSA generation of OIF so that the short circuit optimization still triggers. The short circuit optimization looks for triangle but not diamonds, so don't bother allocating a block if it will be empty. Go 1 benchmarks are in the noise. Fixes #30567 Change-Id: I19c04296bea63cbd6ad05f87a63b005029123610 Reviewed-on: https://go-review.googlesource.com/c/go/+/165617 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit 4a9064ef41ccc65454564536f40cf7d5a00db8ad) Reviewed-on: https://go-review.googlesource.com/c/go/+/165858 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-13[release-branch.go1.12] cmd/go: avoid link errors when -coverpkg covers main ↵Jay Conrod
packages The -coverpkg lets users specify a list of packages that should have coverage instrumentation. This may include packages not transitively imported by tests. For each tested package, the synthetic main package imports all covered packages so they can be registered with testing.RegisterCover. This makes it possible for a main package to import another main package. When we compile a package with p.Internal.BuildInfo set (set on main packages by Package.load in module mode), we set runtime/debug.modinfo. Multiple main packages may be passed to the linker because of the above scenario, so this causes duplicate symbol errors. This change copies p.Internal.BuildInfo to the synthetic main package instead of the internal test package. Additionally, it forces main packages imported by the synthetic test main package to be recompiled for testing. Recompiled packages won't have p.Internal.BuildInfo set. Fixes #30684 Change-Id: I06f028d55905039907940ec89d2835f5a1040203 Reviewed-on: https://go-review.googlesource.com/c/go/+/164877 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 10156b678336f7628a7f1fdd84ffe2a28d66969a) Reviewed-on: https://go-review.googlesource.com/c/go/+/166318 TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-13[release-branch.go1.12] doc/go1.12: new go line in go.mod can break builds ↵Ian Lance Taylor
with Go 1.11 - 1.11.3 Updates #30446 Change-Id: If069f72fa9735f839df92f3ede3bf7b6d7a695a5 Reviewed-on: https://go-review.googlesource.com/c/164317 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit e32203f647370897c6a28018c16cfd9584849569) Reviewed-on: https://go-review.googlesource.com/c/go/+/164318
2019-03-08[release-branch.go1.12] cmd/go/internal/modfetch: handle codeRoot == path ↵Bryan C. Mills
for paths with major-version suffixes Fixes #30665 Change-Id: Icbcfdb3907bc003ac17a8c7df17ecb41daf82eb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/166117 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 1ab9f6837d6da80dad41657a913e47fa13a4fee8) Reviewed-on: https://go-review.googlesource.com/c/go/+/166317
2019-03-05[release-branch.go1.12] path/filepath: don't discard .. in EvalSymlinksIan Lance Taylor
EvalSymlinks was mishandling cases like "/x/../../y" or "../../../x" where there is an extra ".." that goes past the start of the path. Updates #30520 Fixes #30586 Change-Id: I07525575f83009032fa1a99aa270c8d42007d276 Reviewed-on: https://go-review.googlesource.com/c/go/+/164762 Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 294edb272d5d145665bdf8b4254609eae0363a8d) Reviewed-on: https://go-review.googlesource.com/c/go/+/165197 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-05[release-branch.go1.12] os: remove unreadable directories in RemoveAllBaokun Lee
Updates #30555 Fixes #30579 Change-Id: Ib894b4f3cdba23a18a69c9470cf69ceb83591a4d Reviewed-on: https://go-review.googlesource.com/c/go/+/165057 Run-TryBot: Baokun Lee <nototon@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit c74659290a473cf932ec6bc96bfa7e96a930676e) Reviewed-on: https://go-review.googlesource.com/c/go/+/165058 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-03[release-branch.go1.12] doc: fix bad lib/time link in 1.12 release notesAlberto Donizetti
There's a "lib/time" sub-section in the Go 1.12 relase notes that points to a non-existent golang.org/pkg/lib/time page. The note is about a change in the tz database in the src/lib/time directory, but the section's title (and the link) should probably just refer to the time package. Change-Id: Ibf9dacd710e72886f14ad0b7415fea1e8d25b83a Reviewed-on: https://go-review.googlesource.com/c/164977 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 0dc62565401eba11bf9aec127c6c9f5aa4ecf1c9) Reviewed-on: https://go-review.googlesource.com/c/164964 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-01[release-branch.go1.12] runtime: scan defer closure in stack scanCherry Zhang
With stack objects, when we scan the stack, it scans defers with tracebackdefers, but it seems to me that tracebackdefers doesn't include the func value itself, which could be a stack allocated closure. Scan it explicitly. Alternatively, we can change tracebackdefers to include the func value, which in turn needs to change the type of stkframe. Updates #30453. Fixes #30470. Change-Id: I55a6e43264d6952ab2fa5c638bebb89fdc410e2b Reviewed-on: https://go-review.googlesource.com/c/164118 Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 4f4c2a79d4f952b96d58aec2926b4c894245071b) Reviewed-on: https://go-review.googlesource.com/c/164629 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-01[release-branch.go1.12] cmd/go/internal/cache: disable builds if GOCACHE is ↵Baokun Lee
not an absolute path If GOCACHE is set but is not an absolute path, we cannot build. And GOCACHE=off also returns the error message "build cache is disabled by GOCACHE=off". Fixes #30493 Change-Id: I24f64bc886599ca0acd757acada4714aebe4d3ae Reviewed-on: https://go-review.googlesource.com/c/164200 Run-TryBot: Baokun Lee <nototon@gmail.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 13d24b685a6d7b05a249f85be91c390f5595f745) Reviewed-on: https://go-review.googlesource.com/c/164717 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-27[release-branch.go1.12] doc: add 1.10.8 and 1.11.5 to the releases listAlberto Donizetti
Fixes #30431 Change-Id: I379e78a1c385942a19e1a10b91d732f9a73899e6 Reviewed-on: https://go-review.googlesource.com/c/164041 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit d7518ac51879011a732440d4a49dc7043759e2c8) Reviewed-on: https://go-review.googlesource.com/c/164077 Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-02-26[release-branch.go1.12] path/filepath: revert "fix Windows-specific Clean bug"Ian Lance Taylor
Revert CL 137055, which changed Clean("\\somepath\dir\") to return "\\somepath\dir" on Windows. It's not entirely clear this is correct, as this path is really "\\server\share\", and as such the trailing slash may be the path on that share, much like "C:\". In any case, the change broke existing code, so roll it back for now and rethink for 1.13. Updates #27791 Updates #30307 Change-Id: I69200b1efe38bdb6d452b744582a2bfbb3acbcec Reviewed-on: https://go-review.googlesource.com/c/163077 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> (cherry picked from commit 153c0da89bca6726545cf4451053235b552d3d51) Reviewed-on: https://go-review.googlesource.com/c/163078 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-02-26[release-branch.go1.12] doc: add 1.12 to the project historyAlberto Donizetti
Go 1.12 is released, but it's currently not listed in the https://golang.org/project page. Change-Id: Ib5820f74245e4c986014c64eb40fa2911473e64b Reviewed-on: https://go-review.googlesource.com/c/163837 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 467456b0afcbe8b74c49b356f0e5d41d1c6efc9f) Reviewed-on: https://go-review.googlesource.com/c/163727 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-26[release-branch.go1.12] cmd/internal/obj/arm64: fix the bug assembling TSTWfanzha02
Current assembler reports error when it assembles "TSTW $1689262177517664, R3", but go1.11 was building fine. Fixes #30334 Change-Id: I9c16d36717cd05df2134e8eb5b17edc385aff0a9 Reviewed-on: https://go-review.googlesource.com/c/163259 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ben Shi <powerman1st@163.com> (cherry picked from commit 2ef8abb41f2565e38e520c18773308b3cf005af6) Reviewed-on: https://go-review.googlesource.com/c/163419 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-25[release-branch.go1.12] go1.12go1.12Andrew Bonventre
Change-Id: I2fa947f75c0ace671ad8b99c4fab3ad7b178cedf Reviewed-on: https://go-review.googlesource.com/c/163725 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>