Skip to content

Commit 9a54f82

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 22fa2bc + fbac94a commit 9a54f82

File tree

21 files changed

+185
-75
lines changed

21 files changed

+185
-75
lines changed

src/cmd/compile/internal/staticinit/sched.go

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,6 @@ func (s *Schedule) staticAssignInlinedCall(l *ir.Name, loff int64, call *ir.Inli
622622
// INLCALL-ReturnVars
623623
// . NAME-p.~R0 Class:PAUTO Offset:0 OnStack Used PTR-*T tc(1) # x.go:18:13
624624
//
625-
// In non-unified IR, the tree is slightly different:
626-
// - if there are no arguments to the inlined function,
627-
// the INLCALL-init omits the AS2.
628-
// - the DCL inside BLOCK is on the AS2's init list,
629-
// not its own statement in the top level of the BLOCK.
630-
//
631625
// If the init values are side-effect-free and each either only
632626
// appears once in the function body or is safely repeatable,
633627
// then we inline the value expressions into the return argument
@@ -647,39 +641,26 @@ func (s *Schedule) staticAssignInlinedCall(l *ir.Name, loff int64, call *ir.Inli
647641
// is the most important case for us to get right.
648642

649643
init := call.Init()
650-
var as2init *ir.AssignListStmt
651-
if len(init) == 2 && init[0].Op() == ir.OAS2 && init[1].Op() == ir.OINLMARK {
652-
as2init = init[0].(*ir.AssignListStmt)
653-
} else if len(init) == 1 && init[0].Op() == ir.OINLMARK {
654-
as2init = new(ir.AssignListStmt)
655-
} else {
644+
if len(init) != 2 || init[0].Op() != ir.OAS2 || init[1].Op() != ir.OINLMARK {
656645
return false
657646
}
647+
as2init := init[0].(*ir.AssignListStmt)
648+
658649
if len(call.Body) != 2 || call.Body[0].Op() != ir.OBLOCK || call.Body[1].Op() != ir.OLABEL {
659650
return false
660651
}
661652
label := call.Body[1].(*ir.LabelStmt).Label
662653
block := call.Body[0].(*ir.BlockStmt)
663654
list := block.List
664-
var dcl *ir.Decl
665-
if len(list) == 3 && list[0].Op() == ir.ODCL {
666-
dcl = list[0].(*ir.Decl)
667-
list = list[1:]
668-
}
669-
if len(list) != 2 ||
670-
list[0].Op() != ir.OAS2 ||
671-
list[1].Op() != ir.OGOTO ||
672-
list[1].(*ir.BranchStmt).Label != label {
655+
if len(list) != 3 ||
656+
list[0].Op() != ir.ODCL ||
657+
list[1].Op() != ir.OAS2 ||
658+
list[2].Op() != ir.OGOTO ||
659+
list[2].(*ir.BranchStmt).Label != label {
673660
return false
674661
}
675-
as2body := list[0].(*ir.AssignListStmt)
676-
if dcl == nil {
677-
ainit := as2body.Init()
678-
if len(ainit) != 1 || ainit[0].Op() != ir.ODCL {
679-
return false
680-
}
681-
dcl = ainit[0].(*ir.Decl)
682-
}
662+
dcl := list[0].(*ir.Decl)
663+
as2body := list[1].(*ir.AssignListStmt)
683664
if len(as2body.Lhs) != 1 || as2body.Lhs[0] != dcl.X {
684665
return false
685666
}

src/cmd/go/alldocs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/help/helpdoc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Special-purpose environment variables:
695695
The default is GOFIPS140=off, which makes no FIPS-140 changes at all.
696696
Other values enable FIPS-140 compliance measures and select alternate
697697
versions of the cryptography source code.
698-
See https://go.dev/security/fips140 for details.
698+
See https://go.dev/doc/security/fips140 for details.
699699
GO_EXTLINK_ENABLED
700700
Whether the linker should use external linking mode
701701
when using -linkmode=auto with code that uses cgo.

src/cmd/go/internal/modget/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func updateTools(ctx context.Context, queries []*query, opts *modload.WriteOpts)
453453
if queries[i].version == "none" {
454454
opts.DropTools = append(opts.DropTools, m.Pkgs...)
455455
} else {
456-
opts.AddTools = append(opts.DropTools, m.Pkgs...)
456+
opts.AddTools = append(opts.AddTools, m.Pkgs...)
457457
}
458458
}
459459
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Regression test for https://go.dev/issue/74035.
2+
go get -tool example.com/foo/cmd/a example.com/foo/cmd/b
3+
cmp go.mod go.mod.want
4+
5+
-- go.mod --
6+
module example.com/foo
7+
go 1.24
8+
-- go.mod.want --
9+
module example.com/foo
10+
11+
go 1.24
12+
13+
tool (
14+
example.com/foo/cmd/a
15+
example.com/foo/cmd/b
16+
)
17+
-- cmd/a/a.go --
18+
package a
19+
20+
func main() {}
21+
22+
-- cmd/b/b.go --
23+
package b
24+
25+
func main() {}

src/cmd/pprof/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
//
1313
// go tool pprof -h
1414
//
15-
// For an example, see https://blog.golang.org/profiling-go-programs.
15+
// For an example, see https://go.dev/blog/pprof.
1616
package main

src/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ type Context interface {
103103
// }
104104
// }
105105
//
106-
// See https://blog.golang.org/pipelines for more examples of how to use
106+
// See https://go.dev/blog/pipelines for more examples of how to use
107107
// a Done channel for cancellation.
108108
Done() <-chan struct{}
109109

src/crypto/tls/quic.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ type QUICSessionTicketOptions struct {
302302
// Currently, it can only be called once.
303303
func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error {
304304
c := q.conn
305+
if c.config.SessionTicketsDisabled {
306+
return nil
307+
}
305308
if !c.isHandshakeComplete.Load() {
306309
return quicError(errors.New("tls: SendSessionTicket called before handshake completed"))
307310
}

src/crypto/tls/quic_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,18 @@ func TestQUICSessionResumption(t *testing.T) {
231231
if !cli2.conn.ConnectionState().DidResume {
232232
t.Errorf("second connection did not use session resumption")
233233
}
234+
235+
clientConfig.TLSConfig.SessionTicketsDisabled = true
236+
cli3 := newTestQUICClient(t, clientConfig)
237+
cli3.conn.SetTransportParameters(nil)
238+
srv3 := newTestQUICServer(t, serverConfig)
239+
srv3.conn.SetTransportParameters(nil)
240+
if err := runTestQUICConnection(context.Background(), cli3, srv3, nil); err != nil {
241+
t.Fatalf("error during third connection handshake: %v", err)
242+
}
243+
if cli3.conn.ConnectionState().DidResume {
244+
t.Errorf("third connection unexpectedly used session resumption")
245+
}
234246
}
235247

236248
func TestQUICFragmentaryData(t *testing.T) {

src/encoding/gob/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ released version, subject to issues such as security fixes. See the Go compatibi
274274
document for background: https://golang.org/doc/go1compat
275275
276276
See "Gobs of data" for a design discussion of the gob wire format:
277-
https://blog.golang.org/gobs-of-data
277+
https://go.dev/blog/gob
278278
279279
# Security
280280

0 commit comments

Comments
 (0)