diff options
author | Alexander Rakoczy <alex@golang.org> | 2021-08-02 11:56:53 -0400 |
---|---|---|
committer | Alexander Rakoczy <alex@golang.org> | 2021-08-02 11:56:53 -0400 |
commit | c3ccb77d1eca141bcfc0b58908571ff604eb6428 (patch) | |
tree | c8ac652f3a892511bf2934769fbbbf88b282a8f4 | |
parent | c3b47cb598e1ecdbbec110325d9d1979553351fc (diff) | |
parent | b8ca6e59eda969c1d3aed9b0c5bd9e99cf0e7dfe (diff) | |
download | go-c3ccb77d1eca141bcfc0b58908571ff604eb6428.tar.gz go-c3ccb77d1eca141bcfc0b58908571ff604eb6428.zip |
[release-branch.go1.17] all: merge master (b8ca6e5) into release-branch.go1.17
Merge List:
+ 2021-07-31 b8ca6e59ed all: gofmt
+ 2021-07-30 b7a85e0003 net/http/httputil: close incoming ReverseProxy request body
+ 2021-07-29 70fd4e47d7 runtime: avoid possible preemption when returning from Go to C
+ 2021-07-28 9eee0ed439 cmd/go: fix go.mod file name printed in error messages for replacements
+ 2021-07-28 b39e0f461c runtime: don't crash on nil pointers in checkptrAlignment
+ 2021-07-27 7cd10c1149 cmd/go: use .mod instead of .zip to determine if version has go.mod file
+ 2021-07-27 c8cf0f74e4 cmd/go: add missing flag in UsageLine
+ 2021-07-27 7ba8e796c9 testing: clarify T.Name returns a distinct name of the running test
+ 2021-07-27 33ff155970 go/types: preserve untyped constants on the RHS of a shift expression
+ 2021-07-26 840e583ff3 runtime: correct variable name in comment
+ 2021-07-26 bfbb288574 runtime: remove adjustTimers counter
+ 2021-07-26 9c81fd53b3 cmd/vet: add missing copyright header
+ 2021-07-26 ecaa6816bf doc: clarify non-nil zero length slice to array pointer conversion
+ 2021-07-26 1868f8296e crypto/x509: update iOS bundled roots to version 55188.120.1.0.1
+ 2021-07-25 849b791129 spec: use consistent capitalization for rune literal hex constants
+ 2021-07-23 0914646ab9 doc/1.17: fix two dead rfc links
+ 2021-07-22 052da5717e cmd/compile: do not change field offset in ABI analysis
+ 2021-07-22 798ec73519 runtime: don't clear timerModifiedEarliest if adjustTimers is 0
+ 2021-07-22 fdb45acd1f runtime: move mem profile sampling into m-acquired section
+ 2021-07-21 3e48c0381f reflect: add missing copyright header
+ 2021-07-21 48c88f1b1b reflect: add Value.CanConvert
+ 2021-07-20 9e26569293 cmd/go: don't add C compiler ID to hash for standard library
+ 2021-07-20 d568e6e075 runtime/debug: skip TestPanicOnFault on netbsd/arm
+ 2021-07-19 c8f4e6152d spec: correct example comment in Conversions from slice to array
+ 2021-07-19 1d91551b73 time: correct typo in documentation for UnixMicro
+ 2021-07-19 404127c30f cmd/compile: fix off-by-one error in traceback argument counting
+ 2021-07-19 6298cfe672 cmd/compile: fix typo in fatal message of builtinCall
+ 2021-07-19 49402bee36 cmd/{compile,link}: fix bug in map.zero handling
+ 2021-07-18 a66190ecee test/bench/go1: fix size for RegexpMatchMedium_32
+ 2021-07-18 650fc2117a text/scanner: use Go convention in Position doc comment
+ 2021-07-16 aa4e0f528e net/http: correct capitalization in cancelTimeBody comment
+ 2021-07-15 0941dbca6a testing: clarify in docs that TestMain is advanced
+ 2021-07-15 69728ead87 cmd/go: update error messages in tests to match CL 332573
+ 2021-07-15 c1cc9f9c3d cmd/compile: fix lookup package of redeclared dot import symbol
+ 2021-07-15 21a04e3335 doc/go1.17: mention GOARCH=loong64
+ 2021-07-14 2b00a54baf go/build, runtime/internal/sys: reserve GOARCH=loong64
+ 2021-07-14 60ddf42b46 cmd/go: change link in error message from /wiki to /doc.
+ 2021-07-13 d8f348a589 cmd/go: remove a duplicated word from 'go help mod graph'
Change-Id: I63a540ba823bcbde7249348999ac5a7d9908b531
96 files changed, 1016 insertions, 235 deletions
diff --git a/api/go1.17.txt b/api/go1.17.txt index 3d0a464fec5..48505381f1e 100644 --- a/api/go1.17.txt +++ b/api/go1.17.txt @@ -80,6 +80,7 @@ pkg net/url, method (Values) Has(string) bool pkg reflect, func VisibleFields(Type) []StructField pkg reflect, method (Method) IsExported() bool pkg reflect, method (StructField) IsExported() bool +pkg reflect, method (Value) CanConvert(Type) bool pkg runtime/cgo (darwin-amd64-cgo), func NewHandle(interface{}) Handle pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Delete() pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Value() interface{} diff --git a/doc/go1.17.html b/doc/go1.17.html index fa8f14de99d..48811e6b679 100644 --- a/doc/go1.17.html +++ b/doc/go1.17.html @@ -119,6 +119,17 @@ Do not send CLs removing the interior tags from such phrases. stack frame pointers only on Linux, macOS, and iOS. </p> +<h3 id="loong64">loong64 GOARCH value reserved</h3> + +<p><!-- CL 333909 --> + The main Go compiler does not yet support the LoongArch + architecture, but we've reserved the <code>GOARCH</code> value + "<code>loong64</code>". + This means that Go files named <code>*_loong64.go</code> will now + be <a href="/pkg/go/build/#hdr-Build_Constraints">ignored by Go + tools</a> except when that GOARCH value is being used. +</p> + <h2 id="tools">Tools</h2> <h3 id="go-command">Go command</h3> @@ -875,8 +886,8 @@ func Foo() bool { <dd> <p><!-- CL 272668 --> The new method <a href="/pkg/net/#IP.IsPrivate"><code>IP.IsPrivate</code></a> reports whether an address is - a private IPv4 address according to <a href="http://tools.ietf.org/html/rfc1918">RFC 1918</a> - or a local IPv6 address according <a href="http://tools.ietf.org/html/rfc4193">RFC 4193</a>. + a private IPv4 address according to <a href="https://datatracker.ietf.org/doc/rfc1918">RFC 1918</a> + or a local IPv6 address according <a href="https://datatracker.ietf.org/doc/rfc4193">RFC 4193</a>. </p> <p><!-- CL 301709 --> @@ -978,6 +989,18 @@ func Foo() bool { <dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt> <dd> + <p><!-- CL 334669 --> + The new + <a href="/pkg/reflect/#Value.CanConvert"><code>Value.CanConvert</code></a> + method reports whether a value can be converted to a type. + This may be used to avoid a panic when converting a slice to an + array pointer type if the slice is too short. + Previously it was sufficient to use + <a href="/pkg/reflect/#Type.ConvertibleTo"><code>Type.ConvertibleTo</code></a> + for this, but the newly permitted conversion from slice to array + pointer type can panic even if the types are convertible. + </p> + <p><!-- CL 266197 --> The new <a href="/pkg/reflect/#StructField.IsExported"><code>StructField.IsExported</code></a> diff --git a/doc/go_spec.html b/doc/go_spec.html index ad21ffb1b88..0e14a1f3b63 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ <!--{ "Title": "The Go Programming Language Specification", - "Subtitle": "Version of Jul 1, 2021", + "Subtitle": "Version of Jul 26, 2021", "Path": "/ref/spec" }--> @@ -490,8 +490,8 @@ After a backslash, certain single-character escapes represent special values: \n U+000A line feed or newline \r U+000D carriage return \t U+0009 horizontal tab -\v U+000b vertical tab -\\ U+005c backslash +\v U+000B vertical tab +\\ U+005C backslash \' U+0027 single quote (valid escape only within rune literals) \" U+0022 double quote (valid escape only within string literals) </pre> @@ -4334,7 +4334,10 @@ s4 := (*[4]byte)(s) // panics: len([4]byte) > len(s) var t []string t0 := (*[0]string)(t) // t0 == nil -t1 := (*[1]string)(t) // panics: len([1]string) > len(s) +t1 := (*[1]string)(t) // panics: len([1]string) > len(t) + +u := make([]byte, 0) +u0 = (*[0]byte)(u) // u0 != nil </pre> <h3 id="Constant_expressions">Constant expressions</h3> diff --git a/src/cmd/compile/internal/abi/abiutils.go b/src/cmd/compile/internal/abi/abiutils.go index b8ea1955d13..d657ddc867b 100644 --- a/src/cmd/compile/internal/abi/abiutils.go +++ b/src/cmd/compile/internal/abi/abiutils.go @@ -446,35 +446,20 @@ func (config *ABIConfig) ABIAnalyze(t *types.Type, setNname bool) *ABIParamResul return result } -// parameterUpdateMu protects the Offset field of function/method parameters (a subset of structure Fields) -var parameterUpdateMu sync.Mutex - -// FieldOffsetOf returns a concurrency-safe version of f.Offset -func FieldOffsetOf(f *types.Field) int64 { - parameterUpdateMu.Lock() - defer parameterUpdateMu.Unlock() - return f.Offset -} - func (config *ABIConfig) updateOffset(result *ABIParamResultInfo, f *types.Field, a ABIParamAssignment, isReturn, setNname bool) { // Everything except return values in registers has either a frame home (if not in a register) or a frame spill location. if !isReturn || len(a.Registers) == 0 { // The type frame offset DOES NOT show effects of minimum frame size. // Getting this wrong breaks stackmaps, see liveness/plive.go:WriteFuncMap and typebits/typebits.go:Set - parameterUpdateMu.Lock() - defer parameterUpdateMu.Unlock() off := a.FrameOffset(result) fOffset := f.Offset if fOffset == types.BOGUS_FUNARG |