Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f6db735
[release-branch.go1.25] net/url: allow IP-literals with IPv4-mapped I…
rolandshoemaker Oct 9, 2025
7e049e5
[release-branch.go1.25] encoding/pem: properly decode strange PEM data
rolandshoemaker Oct 15, 2025
bbb7627
[release-branch.go1.25] cmd/compile: prevent shapifying of pointer sh…
cuonglm Sep 15, 2025
bf95b76
[release-branch.go1.25] runtime: use one more address bit for tagged …
randall77 Sep 2, 2025
cd21a7b
[release-branch.go1.25] Revert "crypto/internal/fips140/subtle: add a…
randall77 Oct 7, 2025
4942c74
[release-branch.go1.25] Revert "crypto/internal/fips140/subtle: add a…
randall77 Oct 7, 2025
8097b19
[release-branch.go1.25] os: support deleting read-only files in Remov…
qmuntal Oct 21, 2025
5ba37a3
[release-branch.go1.25] cmd/compile: don't optimize away a panicing i…
randall77 Oct 22, 2025
83885f3
[release-branch.go1.25] encoding/pem: properly calculate end indexes
rolandshoemaker Oct 23, 2025
f2cd93a
[release-branch.go1.25] go1.25.4
gopherbot Nov 5, 2025
433c01e
[release-branch.go1.25] internal/syscall/windows: fix ReOpenFile sent…
qmuntal Nov 3, 2025
e1ce1bf
[release-branch.go1.25] mime: parse media types that contain braces
jub0bs Nov 10, 2025
287017a
[release-branch.go1.25] crypto/x509: excluded subdomain constraints p…
rolandshoemaker Nov 24, 2025
f7bce4b
[release-branch.go1.25] crypto/x509: prevent HostnameError.Error() fr…
nicholashusin Nov 24, 2025
fefb02a
[release-branch.go1.25] go1.25.5
gopherbot Dec 2, 2025
0bab982
Merge remote-tracking branch 'go/release-branch.go1.25' into awly/upd…
awly Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
go1.25.3
time 2025-10-13T16:08:43Z
go1.25.5
time 2025-11-26T02:01:51Z
46 changes: 13 additions & 33 deletions src/cmd/compile/internal/noder/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ type pkgReader struct {
// but bitwise inverted so we can detect if we're missing the entry
// or not.
newindex []index

// indicates whether the data is reading during reshaping.
reshaping bool
}

func newPkgReader(pr pkgbits.PkgDecoder) *pkgReader {
Expand Down Expand Up @@ -119,10 +116,6 @@ type reader struct {
// find parameters/results.
funarghack bool

// reshaping is used during reading exprReshape code, preventing
// the reader from shapifying the re-shaped type.
reshaping bool

// methodSym is the name of method's name, if reading a method.
// It's nil if reading a normal function or closure body.
methodSym *types.Sym
Expand Down Expand Up @@ -937,8 +930,19 @@ func shapify(targ *types.Type, basic bool) *types.Type {
// types, and discarding struct field names and tags. However, we'll
// need to start tracking how type parameters are actually used to
// implement some of these optimizations.
pointerShaping := basic && targ.IsPtr() && !targ.Elem().NotInHeap()
// The exception is when the type parameter is a pointer to a type
// which `Type.HasShape()` returns true, but `Type.IsShape()` returns
// false, like `*[]go.shape.T`. This is because the type parameter is
// used to instantiate a generic function inside another generic function.
// In this case, we want to keep the targ as-is, otherwise, we may lose the
// original type after `*[]go.shape.T` is shapified to `*go.shape.uint8`.
// See issue #54535, #71184.
if pointerShaping && !targ.Elem().IsShape() && targ.Elem().HasShape() {
return targ
}
under := targ.Underlying()
if basic && targ.IsPtr() && !targ.Elem().NotInHeap() {
if pointerShaping {
under = types.NewPtr(types.Types[types.TUINT8])
}

Expand Down Expand Up @@ -1014,25 +1018,7 @@ func (pr *pkgReader) objDictIdx(sym *types.Sym, idx index, implicits, explicits
// arguments.
for i, targ := range dict.targs {
basic := r.Bool()
isPointerShape := basic && targ.IsPtr() && !targ.Elem().NotInHeap()
// We should not do shapify during the reshaping process, see #71184.
// However, this only matters for shapify a pointer type, which will
// lose the original underlying type.
//
// Example with a pointer type:
//
// - First, shapifying *[]T -> *uint8
// - During the reshaping process, *uint8 is shapified to *go.shape.uint8
// - This ends up with a different type with the original *[]T
//
// For a non-pointer type:
//
// - int -> go.shape.int
// - go.shape.int -> go.shape.int
//
// We always end up with the identical type.
canShapify := !pr.reshaping || !isPointerShape
if dict.shaped && canShapify {
if dict.shaped {
dict.targs[i] = shapify(targ, basic)
}
}
Expand Down Expand Up @@ -2470,10 +2456,7 @@ func (r *reader) expr() (res ir.Node) {

case exprReshape:
typ := r.typ()
old := r.reshaping
r.reshaping = true
x := r.expr()
r.reshaping = old

if types.IdenticalStrict(x.Type(), typ) {
return x
Expand Down Expand Up @@ -2596,10 +2579,7 @@ func (r *reader) funcInst(pos src.XPos) (wrapperFn, baseFn, dictPtr ir.Node) {
info := r.dict.subdicts[idx]
explicits := r.p.typListIdx(info.explicits, r.dict)

old := r.p.reshaping
r.p.reshaping = r.reshaping
baseFn = r.p.objIdx(info.idx, implicits, explicits, true).(*ir.Name)
r.p.reshaping = old

// TODO(mdempsky): Is there a more robust way to get the
// dictionary pointer type here?
Expand Down
10 changes: 6 additions & 4 deletions src/cmd/compile/internal/ssa/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,7 @@ func rewriteStructStore(v *Value) *Value {

// isDirectType reports whether v represents a type
// (a *runtime._type) whose value is stored directly in an
// interface (i.e., is pointer or pointer-like).
// interface (i.e., is pointer or pointer-like) and is comparable.
func isDirectType(v *Value) bool {
return isDirectType1(v)
}
Expand All @@ -2571,7 +2571,8 @@ func isDirectType1(v *Value) bool {
return false
}
if ti, ok := (*lsym.Extra).(*obj.TypeInfo); ok {
return types.IsDirectIface(ti.Type.(*types.Type))
t := ti.Type.(*types.Type)
return types.IsDirectIface(t) && types.IsComparable(t)
}
}
return false
Expand All @@ -2588,7 +2589,7 @@ func isDirectType2(v *Value) bool {

// isDirectIface reports whether v represents an itab
// (a *runtime._itab) for a type whose value is stored directly
// in an interface (i.e., is pointer or pointer-like).
// in an interface (i.e., is pointer or pointer-like) and is comparable.
func isDirectIface(v *Value) bool {
return isDirectIface1(v, 9)
}
Expand All @@ -2607,7 +2608,8 @@ func isDirectIface1(v *Value, depth int) bool {
return false
}
if ii, ok := (*lsym.Extra).(*obj.ItabInfo); ok {
return types.IsDirectIface(ii.Type.(*types.Type))
t := ii.Type.(*types.Type)
return types.IsDirectIface(t) && types.IsComparable(t)
}
case OpConstNil:
// We can treat this as direct, because if the itab is
Expand Down
78 changes: 78 additions & 0 deletions src/cmd/compile/testdata/script/issue75461.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
go build main.go
! stdout .
! stderr .

-- main.go --
package main

import (
"demo/registry"
)

func main() {
_ = registry.NewUserRegistry()
}

-- go.mod --
module demo

go 1.24

-- model/user.go --
package model

type User struct {
ID int
}

func (c *User) String() string {
return ""
}

-- ordered/map.go --
package ordered

type OrderedMap[K comparable, V any] struct {
m map[K]V
}

func New[K comparable, V any](options ...any) *OrderedMap[K, V] {
orderedMap := &OrderedMap[K, V]{}
return orderedMap
}

-- registry/user.go --
package registry

import (
"demo/model"
"demo/ordered"
)

type baseRegistry = Registry[model.User, *model.User]

type UserRegistry struct {
*baseRegistry
}

type Registry[T any, P PStringer[T]] struct {
m *ordered.OrderedMap[string, P]
}

type PStringer[T any] interface {
*T
String() string
}

func NewRegistry[T any, P PStringer[T]]() *Registry[T, P] {
r := &Registry[T, P]{
m: ordered.New[string, P](),
}
return r
}

func NewUserRegistry() *UserRegistry {
return &UserRegistry{
baseRegistry: NewRegistry[model.User](),
}
}
2 changes: 1 addition & 1 deletion src/crypto/internal/fips140/subtle/xor_asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (amd64 || arm64 || mips || mipsle || mips64 || mips64le || ppc64 || ppc64le || riscv64) && !purego
//go:build (amd64 || arm64 || ppc64 || ppc64le || riscv64) && !purego

package subtle

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/internal/fips140/subtle/xor_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (!amd64 && !arm64 && !loong64 && !mips && !mipsle && !mips64 && !mips64le && !ppc64 && !ppc64le && !riscv64) || purego
//go:build (!amd64 && !arm64 && !loong64 && !ppc64 && !ppc64le && !riscv64) || purego

package subtle

Expand Down
153 changes: 0 additions & 153 deletions src/crypto/internal/fips140/subtle/xor_mips64x.s

This file was deleted.

Loading
Loading