mirror of
https://github.com/golang/go.git
synced 2026-01-29 23:22:06 +03:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21a4e67ad5 | ||
|
|
328cf2e8b2 | ||
|
|
fcce86c4cf | ||
|
|
36c171763e | ||
|
|
678b07d5e5 | ||
|
|
14c9b1e00b | ||
|
|
c35f8a37d9 | ||
|
|
47a57bc4f0 | ||
|
|
2d97a87287 | ||
|
|
3969694203 | ||
|
|
1dd24caf08 | ||
|
|
ec5170397c | ||
|
|
fdd6dfd507 | ||
|
|
f7b9470992 | ||
|
|
4397d66bdd | ||
|
|
eb5a7b5050 | ||
|
|
72ab3ff68b | ||
|
|
c3ccb77d1e | ||
|
|
c3b47cb598 | ||
|
|
ddfd72f7d1 | ||
|
|
d6f4d9a2be |
@@ -1 +1,2 @@
|
||||
branch: master
|
||||
branch: release-branch.go1.17
|
||||
parent-branch: master
|
||||
|
||||
@@ -753,9 +753,9 @@ func Foo() bool {
|
||||
|
||||
<p><!-- CL 311572 -->
|
||||
The new
|
||||
<a href="/pkg/database/sql/#NullInt16"><code>NullInt16</code></a>
|
||||
and
|
||||
<a href="/pkg/database/sql/#NullByte"><code>NullByte</code></a>
|
||||
<a href="/pkg/database/sql/#NullInt16"><code>NullInt16</code></a>
|
||||
and
|
||||
<a href="/pkg/database/sql/#NullByte"><code>NullByte</code></a>
|
||||
structs represent the int16 and byte values that may be null. These can be used as
|
||||
destinations of the <a href="/pkg/database/sql/#Scan"><code>Scan</code></a> method,
|
||||
similar to NullString.
|
||||
@@ -1205,11 +1205,11 @@ func Foo() bool {
|
||||
|
||||
<p><!-- CL 300996 -->
|
||||
The package now accepts comma "," as a separator for fractional seconds when parsing and formatting time.
|
||||
The following time formats are now accepted:
|
||||
For example, the following time layouts are now accepted:
|
||||
<ul>
|
||||
<li>2006-01-02 14:06:03,999999999 -0700 MST</li>
|
||||
<li>Mon Jan _2 14:06:03,120007 2006</li>
|
||||
<li>Mon Jan 2 14:06:03,120007 2006</li>
|
||||
<li>2006-01-02 15:04:05,999999999 -0700 MST</li>
|
||||
<li>Mon Jan _2 15:04:05,000000 2006</li>
|
||||
<li>Monday, January 2 15:04:05,000 2006</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
// indicate it contains up to 1 << 128 - 1 files. Since each file has a
|
||||
// header which will be _at least_ 30 bytes we can safely preallocate
|
||||
// if (data size / 30) >= end.directoryRecords.
|
||||
if (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
if end.directorySize < uint64(size) && (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
z.File = make([]*File, 0, end.directoryRecords)
|
||||
}
|
||||
z.Comment = end.comment
|
||||
|
||||
@@ -1384,3 +1384,21 @@ func TestCVE202133196(t *testing.T) {
|
||||
t.Errorf("Archive has unexpected number of files, got %d, want 5", len(r.File))
|
||||
}
|
||||
}
|
||||
|
||||
func TestCVE202139293(t *testing.T) {
|
||||
// directory size is so large, that the check in Reader.init
|
||||
// overflows when subtracting from the archive size, causing
|
||||
// the pre-allocation check to be bypassed.
|
||||
data := []byte{
|
||||
0x50, 0x4b, 0x06, 0x06, 0x05, 0x06, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0xff, 0x50, 0xfe, 0x00, 0xff, 0x00, 0x3a, 0x00, 0x00, 0x00, 0xff,
|
||||
}
|
||||
_, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
if err != ErrFormat {
|
||||
t.Fatalf("unexpected error, got: %v, want: %v", err, ErrFormat)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ func embedKind(typ *types.Type) int {
|
||||
if typ.Kind() == types.TSTRING {
|
||||
return embedString
|
||||
}
|
||||
if typ.Sym() == nil && typ.IsSlice() && typ.Elem().Kind() == types.TUINT8 {
|
||||
if typ.IsSlice() && typ.Elem().Kind() == types.TUINT8 {
|
||||
return embedBytes
|
||||
}
|
||||
return embedUnknown
|
||||
|
||||
@@ -1222,12 +1222,14 @@ func (r *importReader) node() ir.Node {
|
||||
switch op {
|
||||
case ir.ODOT, ir.ODOTPTR, ir.ODOTINTER:
|
||||
n.Selection = r.exoticField()
|
||||
case ir.ODOTMETH, ir.OCALLPART, ir.OMETHEXPR:
|
||||
case ir.OMETHEXPR:
|
||||
n = typecheckMethodExpr(n).(*ir.SelectorExpr)
|
||||
case ir.ODOTMETH, ir.OCALLPART:
|
||||
// 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.OCALLPART || op == ir.OMETHEXPR {
|
||||
if op == ir.OCALLPART {
|
||||
// Lookdot clobbers the opcode and type, undo that.
|
||||
n.SetOp(op)
|
||||
n.SetType(typ)
|
||||
|
||||
@@ -190,8 +190,8 @@ func limiterForEdit(ctx context.Context, rs *Requirements, tryUpgrade, mustSelec
|
||||
|
||||
// raiseLimitsForUpgrades increases the module versions in maxVersions to the
|
||||
// versions that would be needed to allow each of the modules in tryUpgrade
|
||||
// (individually) and all of the modules in mustSelect (simultaneously) to be
|
||||
// added as roots.
|
||||
// (individually or in any combination) and all of the modules in mustSelect
|
||||
// (simultaneously) to be added as roots.
|
||||
//
|
||||
// Versions not present in maxVersion are unrestricted, and it is assumed that
|
||||
// they will not be promoted to root requirements (and thus will not contribute
|
||||
@@ -213,18 +213,42 @@ func raiseLimitsForUpgrades(ctx context.Context, maxVersion map[string]string, d
|
||||
}
|
||||
}
|
||||
|
||||
var eagerUpgrades []module.Version
|
||||
var (
|
||||
eagerUpgrades []module.Version
|
||||
isLazyRootPath map[string]bool
|
||||
)
|
||||
if depth == eager {
|
||||
eagerUpgrades = tryUpgrade
|
||||
} else {
|
||||
isLazyRootPath = make(map[string]bool, len(maxVersion))
|
||||
for p := range maxVersion {
|
||||
isLazyRootPath[p] = true
|
||||
}
|
||||
for _, m := range tryUpgrade {
|
||||
isLazyRootPath[m.Path] = true
|
||||
}
|
||||
for _, m := range mustSelect {
|
||||
isLazyRootPath[m.Path] = true
|
||||
}
|
||||
|
||||
allowedRoot := map[module.Version]bool{}
|
||||
|
||||
var allowRoot func(m module.Version) error
|
||||
allowRoot = func(m module.Version) error {
|
||||
if allowedRoot[m] {
|
||||
return nil
|
||||
}
|
||||
allowedRoot[m] = true
|
||||
|
||||
if m.Path == Target.Path {
|
||||
// Target is already considered to be higher than any possible m, so we
|
||||
// won't be upgrading to it anyway and there is no point scanning its
|
||||
// dependencies.
|
||||
continue
|
||||
return nil
|
||||
}
|
||||
|
||||
allow(m)
|
||||
|
||||
summary, err := goModSummary(m)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -234,12 +258,27 @@ func raiseLimitsForUpgrades(ctx context.Context, maxVersion map[string]string, d
|
||||
// graph, rather than loading the (potentially-overlapping) subgraph for
|
||||
// each upgrade individually.
|
||||
eagerUpgrades = append(eagerUpgrades, m)
|
||||
continue
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, r := range summary.require {
|
||||
allow(r)
|
||||
if isLazyRootPath[r.Path] {
|
||||
// r could become a root as the result of an upgrade or downgrade,
|
||||
// in which case its dependencies will not be pruned out.
|
||||
// We need to allow those dependencies to be upgraded too.
|
||||
if err := allowRoot(r); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
// r will not become a root, so its dependencies don't matter.
|
||||
// Allow only r itself.
|
||||
allow(r)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, m := range tryUpgrade {
|
||||
allowRoot(m)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,16 +307,41 @@ func raiseLimitsForUpgrades(ctx context.Context, maxVersion map[string]string, d
|
||||
}
|
||||
}
|
||||
|
||||
if len(mustSelect) > 0 {
|
||||
mustGraph, err := readModGraph(ctx, depth, mustSelect)
|
||||
// Explicitly allow any (transitive) upgrades implied by mustSelect.
|
||||
nextRoots := append([]module.Version(nil), mustSelect...)
|
||||
for nextRoots != nil {
|
||||
module.Sort(nextRoots)
|
||||
rs := newRequirements(depth, nextRoots, nil)
|
||||
nextRoots = nil
|
||||
|
||||
rs, mustGraph, err := expandGraph(ctx, rs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, r := range mustGraph.BuildList() {
|
||||
// Some module in mustSelect requires r, so we must allow at least r.Version
|
||||
// unless it conflicts with an entry in mustSelect.
|
||||
// Some module in mustSelect requires r, so we must allow at least
|
||||
// r.Version (unless it conflicts with another entry in mustSelect, in
|
||||
// which case we will error out either way).
|
||||
allow(r)
|
||||
|
||||
if isLazyRootPath[r.Path] {
|
||||
if v, ok := rs.rootSelected(r.Path); ok && r.Version == v {
|
||||
// r is already a root, so its requirements are already included in
|
||||
// the build list.
|
||||
continue
|
||||
}
|
||||
|
||||
// The dependencies in mustSelect may upgrade (or downgrade) an existing
|
||||
// root to match r, which will remain as a root. However, since r is not
|
||||
// a root of rs, its dependencies have been pruned out of this build
|
||||
// list. We need to add it back explicitly so that we allow any
|
||||
// transitive upgrades that r will pull in.
|
||||
if nextRoots == nil {
|
||||
nextRoots = rs.rootModules // already capped
|
||||
}
|
||||
nextRoots = append(nextRoots, r)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
117
src/cmd/go/testdata/script/mod_get_issue47979.txt
vendored
Normal file
117
src/cmd/go/testdata/script/mod_get_issue47979.txt
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# Regression test for https://golang.org/issue/47979:
|
||||
#
|
||||
# An argument to 'go get' that results in an upgrade to a different existing
|
||||
# root should be allowed, and should not panic the 'go' command.
|
||||
|
||||
cp go.mod go.mod.orig
|
||||
|
||||
|
||||
# Transitive upgrades from upgraded roots should not prevent
|
||||
# 'go get -u' from performing upgrades.
|
||||
|
||||
cp go.mod.orig go.mod
|
||||
go get -u -d .
|
||||
cmp go.mod go.mod.want
|
||||
|
||||
|
||||
# 'go get' of a specific version should allow upgrades of
|
||||
# every dependency (transitively) required by that version,
|
||||
# including dependencies that are pulled into the module
|
||||
# graph by upgrading other root requirements
|
||||
# (in this case, example.net/indirect).
|
||||
|
||||
cp go.mod.orig go.mod
|
||||
go get -d example.net/a@v0.2.0
|
||||
cmp go.mod go.mod.want
|
||||
|
||||
|
||||
-- go.mod --
|
||||
module golang.org/issue47979
|
||||
|
||||
go 1.17
|
||||
|
||||
replace (
|
||||
example.net/a v0.1.0 => ./a1
|
||||
example.net/a v0.2.0 => ./a2
|
||||
example.net/indirect v0.1.0 => ./indirect1
|
||||
example.net/indirect v0.2.0 => ./indirect2
|
||||
example.net/other v0.1.0 => ./other
|
||||
example.net/other v0.2.0 => ./other
|
||||
)
|
||||
|
||||
require (
|
||||
example.net/a v0.1.0
|
||||
example.net/other v0.1.0
|
||||
)
|
||||
|
||||
require example.net/indirect v0.1.0 // indirect
|
||||
-- go.mod.want --
|
||||
module golang.org/issue47979
|
||||
|
||||
go 1.17
|
||||
|
||||
replace (
|
||||
example.net/a v0.1.0 => ./a1
|
||||
example.net/a v0.2.0 => ./a2
|
||||
example.net/indirect v0.1.0 => ./indirect1
|
||||
example.net/indirect v0.2.0 => ./indirect2
|
||||
example.net/other v0.1.0 => ./other
|
||||
example.net/other v0.2.0 => ./other
|
||||
)
|
||||
|
||||
require (
|
||||
example.net/a v0.2.0
|
||||
example.net/other v0.2.0
|
||||
)
|
||||
|
||||
require example.net/indirect v0.2.0 // indirect
|
||||
-- issue.go --
|
||||
package issue
|
||||
|
||||
import _ "example.net/a"
|
||||
-- useother/useother.go --
|
||||
package useother
|
||||
|
||||
import _ "example.net/other"
|
||||
-- a1/go.mod --
|
||||
module example.net/a
|
||||
|
||||
go 1.17
|
||||
|
||||
require example.net/indirect v0.1.0
|
||||
-- a1/a.go --
|
||||
package a
|
||||
-- a2/go.mod --
|
||||
module example.net/a
|
||||
|
||||
go 1.17
|
||||
|
||||
require example.net/indirect v0.2.0
|
||||
-- a2/a.go --
|
||||
package a
|
||||
|
||||
import "example.net/indirect"
|
||||
-- indirect1/go.mod --
|
||||
module example.net/indirect
|
||||
|
||||
go 1.17
|
||||
|
||||
require example.net/other v0.1.0
|
||||
-- indirect1/indirect.go --
|
||||
package indirect
|
||||
-- indirect2/go.mod --
|
||||
module example.net/indirect
|
||||
|
||||
go 1.17
|
||||
|
||||
require example.net/other v0.2.0
|
||||
-- indirect2/indirect.go --
|
||||
package indirect
|
||||
|
||||
import "example.net/other"
|
||||
-- other/go.mod --
|
||||
module example.net/other
|
||||
|
||||
go 1.17
|
||||
-- other/other.go --
|
||||
package other
|
||||
68
src/cmd/go/testdata/script/mod_get_lazy_upgrade_lazy.txt
vendored
Normal file
68
src/cmd/go/testdata/script/mod_get_lazy_upgrade_lazy.txt
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# Check that 'go get -u' will upgrade a dependency (direct or indirect)
|
||||
# when the main module and the dependency are both lazy.
|
||||
# Verifies #47768.
|
||||
|
||||
# Check that go.mod is tidy, and an upgrade is available.
|
||||
cp go.mod go.mod.orig
|
||||
go mod tidy
|
||||
cmp go.mod go.mod.orig
|
||||
|
||||
go list -m -u example.com/lazyupgrade
|
||||
stdout '^example.com/lazyupgrade v0.1.0 \[v0.1.1\] => ./lazyupgrade@v0.1.0$'
|
||||
|
||||
# 'go get -u' on a package that directly imports the dependency should upgrade.
|
||||
go get -u ./usedirect
|
||||
go list -m example.com/lazyupgrade
|
||||
stdout '^example.com/lazyupgrade v0.1.1 => ./lazyupgrade@v0.1.1$'
|
||||
cp go.mod.orig go.mod
|
||||
|
||||
# 'go get -u' on a package that indirectly imports the dependency should upgrade.
|
||||
go get -u ./useindirect
|
||||
go list -m example.com/lazyupgrade
|
||||
stdout '^example.com/lazyupgrade v0.1.1 => ./lazyupgrade@v0.1.1$'
|
||||
|
||||
-- go.mod --
|
||||
module use
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
direct v0.0.0
|
||||
example.com/lazyupgrade v0.1.0
|
||||
)
|
||||
|
||||
replace (
|
||||
direct => ./direct
|
||||
example.com/lazyupgrade v0.1.0 => ./lazyupgrade@v0.1.0
|
||||
example.com/lazyupgrade v0.1.1 => ./lazyupgrade@v0.1.1
|
||||
)
|
||||
-- usedirect/usedirect.go --
|
||||
package use
|
||||
|
||||
import _ "example.com/lazyupgrade"
|
||||
-- useindirect/useindirect.go --
|
||||
package use
|
||||
|
||||
import _ "direct"
|
||||
-- direct/go.mod --
|
||||
module direct
|
||||
|
||||
go 1.17
|
||||
|
||||
require example.com/lazyupgrade v0.1.0
|
||||
-- direct/direct.go --
|
||||
package direct
|
||||
|
||||
import _ "example.com/lazyupgrade"
|
||||
-- lazyupgrade@v0.1.0/go.mod --
|
||||
module example.com/lazyupgrade
|
||||
|
||||
go 1.17
|
||||
-- lazyupgrade@v0.1.0/lazyupgrade.go --
|
||||
package lazyupgrade
|
||||
-- lazyupgrade@v0.1.1/go.mod --
|
||||
module example.com/lazyupgrade
|
||||
|
||||
go 1.17
|
||||
-- lazyupgrade@v0.1.1/lazyupgrade.go --
|
||||
package lazyupgrade
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"fmt"
|
||||
"internal/buildcfg"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
@@ -1749,7 +1750,7 @@ func asmbElf(ctxt *Link) {
|
||||
sh.Flags = uint64(elf.SHF_ALLOC)
|
||||
sh.Addralign = 1
|
||||
|
||||
if interpreter == "" && buildcfg.GO_LDSO != "" {
|
||||
if interpreter == "" && buildcfg.GOOS == runtime.GOOS && buildcfg.GOARCH == runtime.GOARCH && buildcfg.GO_LDSO != "" {
|
||||
interpreter = buildcfg.GO_LDSO
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin || openbsd
|
||||
// +build darwin openbsd
|
||||
//go:build (darwin && !ios) || openbsd
|
||||
// +build darwin,!ios openbsd
|
||||
|
||||
package rand
|
||||
|
||||
|
||||
@@ -129,3 +129,43 @@ func TestUninitialized(t *testing.T) {
|
||||
t.Errorf("in uninitialized embed.FS, . is not a directory")
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
//go:embed "testdata/hello.txt"
|
||||
helloT []T
|
||||
//go:embed "testdata/hello.txt"
|
||||
helloUint8 []uint8
|
||||
//go:embed "testdata/hello.txt"
|
||||
helloEUint8 []EmbedUint8
|
||||
//go:embed "testdata/hello.txt"
|
||||
helloBytes EmbedBytes
|
||||
//go:embed "testdata/hello.txt"
|
||||
helloString EmbedString
|
||||
)
|
||||
|
||||
type T byte
|
||||
type EmbedUint8 uint8
|
||||
type EmbedBytes []byte
|
||||
type EmbedString string
|
||||
|
||||
// golang.org/issue/47735
|
||||
func TestAliases(t *testing.T) {
|
||||
all := testDirAll
|
||||
want, e := all.ReadFile("testdata/hello.txt")
|
||||
if e != nil {
|
||||
t.Fatal("ReadFile:", e)
|
||||
}
|
||||
check := func(g interface{}) {
|
||||
got := reflect.ValueOf(g)
|
||||
for i := 0; i < got.Len(); i++ {
|
||||
if byte(got.Index(i).Uint()) != want[i] {
|
||||
t.Fatalf("got %v want %v", got.Bytes(), want)
|
||||
}
|
||||
}
|
||||
}
|
||||
check(helloT)
|
||||
check(helloUint8)
|
||||
check(helloEUint8)
|
||||
check(helloBytes)
|
||||
check(helloString)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.17
|
||||
|
||||
require (
|
||||
golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed
|
||||
golang.org/x/net v0.0.0-20210901185426-6d2eada6345e
|
||||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 // indirect
|
||||
golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f // indirect
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e h1:8foAy0aoO5GkqCvAEJ4VC4P3zksTg4X4aJCDpZzmgQI=
|
||||
golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I=
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210901185426-6d2eada6345e h1:50pLUXxddAhYigPZvsrMVrd+113EKnh8VVRKuSaRviw=
|
||||
golang.org/x/net v0.0.0-20210901185426-6d2eada6345e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q=
|
||||
|
||||
@@ -224,7 +224,6 @@ func (check *Checker) exprList(elist []ast.Expr, allowCommaOk bool) (xlist []*op
|
||||
// exactly one (possibly invalid or comma-ok) value
|
||||
xlist = []*operand{&x}
|
||||
if allowCommaOk && (x.mode == mapindex || x.mode == commaok || x.mode == commaerr) {
|
||||
x.mode = value
|
||||
x2 := &operand{mode: value, expr: e, typ: Typ[UntypedBool]}
|
||||
if x.mode == commaerr {
|
||||
x2.typ = universeError
|
||||
|
||||
@@ -276,7 +276,7 @@ func (check *Checker) collectObjects() {
|
||||
}
|
||||
|
||||
if name == "init" {
|
||||
check.errorf(d.spec.Name, _InvalidInitDecl, "cannot import package as init - init must be a func")
|
||||
check.errorf(d.spec, _InvalidInitDecl, "cannot import package as init - init must be a func")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin && !ios
|
||||
// +build darwin,!ios
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
|
||||
@@ -4519,6 +4519,15 @@ func (sc *http2serverConn) serve() {
|
||||
case res := <-sc.wroteFrameCh:
|
||||
sc.wroteFrame(res)
|
||||
case res := <-sc.readFrameCh:
|
||||
// Process any written frames before reading new frames from the client since a
|
||||
// written frame could have triggered a new stream to be started.
|
||||
if sc.writingFrameAsync {
|
||||
select {
|
||||
case wroteRes := <-sc.wroteFrameCh:
|
||||
sc.wroteFrame(wroteRes)
|
||||
default:
|
||||
}
|
||||
}
|
||||
if !sc.processFrameFromReader(res) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -4686,7 +4686,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
|
||||
return
|
||||
}
|
||||
|
||||
// On mips{,le}, 64bit atomics are emulated with spinlocks, in
|
||||
// On mips{,le}/arm, 64bit atomics are emulated with spinlocks, in
|
||||
// runtime/internal/atomic. If SIGPROF arrives while the program is inside
|
||||
// the critical section, it creates a deadlock (when writing the sample).
|
||||
// As a workaround, create a counter of SIGPROFs while in critical section
|
||||
@@ -4699,6 +4699,13 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if GOARCH == "arm" && goarm < 7 && GOOS == "linux" && pc&0xffff0000 == 0xffff0000 {
|
||||
// runtime/internal/atomic functions call into kernel
|
||||
// helpers on arm < 7. See
|
||||
// runtime/internal/atomic/sys_linux_arm.s.
|
||||
cpuprof.lostAtomic++
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Profiling runs concurrently with GC, so it must not allocate.
|
||||
|
||||
@@ -126,7 +126,7 @@ func (v *Value) Swap(new interface{}) (old interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// CompareAndSwapPointer executes the compare-and-swap operation for the Value.
|
||||
// CompareAndSwap executes the compare-and-swap operation for the Value.
|
||||
//
|
||||
// All calls to CompareAndSwap for a given Value must use values of the same
|
||||
// concrete type. CompareAndSwap of an inconsistent type panics, as does
|
||||
|
||||
@@ -77,9 +77,9 @@ import "errors"
|
||||
// The formats and 002 are space-padded and zero-padded
|
||||
// three-character day of year; there is no unpadded day of year format.
|
||||
//
|
||||
// A decimal point followed by one or more zeros represents a fractional
|
||||
// second, printed to the given number of decimal places.
|
||||
// Either a comma or decimal point followed by one or more nines represents
|
||||
// A comma or decimal point followed by one or more zeros represents
|
||||
// a fractional second, printed to the given number of decimal places.
|
||||
// A comma or decimal point followed by one or more nines represents
|
||||
// a fractional second, printed to the given number of decimal places, with
|
||||
// trailing zeros removed.
|
||||
// For example "15:04:05,000" or "15:04:05.000" formats or parses with
|
||||
|
||||
2
src/vendor/modules.txt
vendored
2
src/vendor/modules.txt
vendored
@@ -8,7 +8,7 @@ golang.org/x/crypto/curve25519
|
||||
golang.org/x/crypto/hkdf
|
||||
golang.org/x/crypto/internal/subtle
|
||||
golang.org/x/crypto/poly1305
|
||||
# golang.org/x/net v0.0.0-20210510120150-4163338589ed
|
||||
# golang.org/x/net v0.0.0-20210901185426-6d2eada6345e
|
||||
## explicit; go 1.17
|
||||
golang.org/x/net/dns/dnsmessage
|
||||
golang.org/x/net/http/httpguts
|
||||
|
||||
22
test/fixedbugs/issue48088.dir/a.go
Normal file
22
test/fixedbugs/issue48088.dir/a.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// 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 a
|
||||
|
||||
type T1 struct {
|
||||
*T2
|
||||
}
|
||||
|
||||
type T2 struct {
|
||||
}
|
||||
|
||||
func (t2 *T2) M() {
|
||||
}
|
||||
|
||||
func F() {
|
||||
f(T1.M)
|
||||
}
|
||||
|
||||
func f(f func(T1)) {
|
||||
}
|
||||
11
test/fixedbugs/issue48088.dir/b.go
Normal file
11
test/fixedbugs/issue48088.dir/b.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// 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 b
|
||||
|
||||
import "a"
|
||||
|
||||
func F() {
|
||||
a.F()
|
||||
}
|
||||
7
test/fixedbugs/issue48088.go
Normal file
7
test/fixedbugs/issue48088.go
Normal file
@@ -0,0 +1,7 @@
|
||||
// compiledir
|
||||
|
||||
// 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 ignored
|
||||
Reference in New Issue
Block a user