Skip to content

Commit

Permalink
Merge branch 'master' of github.com:golang/go
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhavdogra committed Mar 6, 2025
2 parents 1b0b605 + 6ba91df commit 7ff3071
Show file tree
Hide file tree
Showing 180 changed files with 3,820 additions and 780 deletions.
16 changes: 16 additions & 0 deletions api/go1.25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pkg go/types, const FieldVar = 6 #70250
pkg go/types, const FieldVar VarKind #70250
pkg go/types, const LocalVar = 2 #70250
pkg go/types, const LocalVar VarKind #70250
pkg go/types, const PackageVar = 1 #70250
pkg go/types, const PackageVar VarKind #70250
pkg go/types, const ParamVar = 4 #70250
pkg go/types, const ParamVar VarKind #70250
pkg go/types, const RecvVar = 3 #70250
pkg go/types, const RecvVar VarKind #70250
pkg go/types, const ResultVar = 5 #70250
pkg go/types, const ResultVar VarKind #70250
pkg go/types, method (*Var) Kind() VarKind #70250
pkg go/types, method (*Var) SetKind(VarKind) #70250
pkg go/types, method (VarKind) String() string #70250
pkg go/types, type VarKind uint8 #70250
7 changes: 7 additions & 0 deletions doc/initial/6-stdlib/99-minor/0-heading.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### Minor changes to the library {#minor_library_changes}

#### go/types

The `Var.Kind` method returns an enumeration of type `VarKind` that
classifies the variable (package-level, local, receiver, parameter,
result, or struct field). See issue #70250.

Callers of `NewVar` or `NewParam` are encouraged to call `Var.SetKind`
to ensure that this attribute is set correctly in all cases.
8 changes: 8 additions & 0 deletions doc/next/3-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@

### Go command {#go-command}

The `go build` `-asan` option now defaults to doing leak detection at
program exit.
This will report an error if memory allocated by C is not freed and is
not referenced by any other memory allocated by either C or Go.
These new error reports may be disabled by setting
`ASAN_OPTIONS=detect_leaks=0` in the environment when running the
program.

### Cgo {#cgo}

2 changes: 2 additions & 0 deletions doc/next/6-stdlib/99-minor/crypto/elliptic/hidden.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The hidden and undocumented `Inverse` and `CombinedMult` methods on some [Curve]
implementations have been removed.
179 changes: 179 additions & 0 deletions src/cmd/asm/internal/asm/testdata/loong64enc1.s
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,15 @@ lable2:
FTINTVF F0, F1 // 01241b01
FTINTVD F0, F1 // 01281b01

FMAXAF F4, F5, F6 // a6900c01
FMAXAF F4, F5 // a5900c01
FMAXAD F4, F5, F6 // a6100d01
FMAXAD F4, F5 // a5100d01
FMINAF F4, F5, F6 // a6900e01
FMINAF F4, F5 // a5900e01
FMINAD F4, F5, F6 // a6100f01
FMINAD F4, F5 // a5100f01

FTINTRMWF F0, F2 // 02041a01
FTINTRMWD F0, F2 // 02081a01
FTINTRMVF F0, F2 // 02241a01
Expand Down Expand Up @@ -540,3 +549,173 @@ lable2:
// AND C_SCON, [r1], r2
AND $0x321, R4 // AND $801, R4 // 84844c03
AND $0x321, R5, R4 // AND $801, R5, R4 // a4844c03

// [X]{VSLL/VSRL/VSRA/VROTR}{B,H,W,V} instructions
VSLLB V1, V2, V3 // 4304e870
VSLLH V1, V2, V3 // 4384e870
VSLLW V1, V2, V3 // 4304e970
VSLLV V1, V2, V3 // 4384e970
VSRLB V1, V2, V3 // 4304ea70
VSRLH V1, V2, V3 // 4384ea70
VSRLW V1, V2, V3 // 4304eb70
VSRLV V1, V2, V3 // 4384eb70
VSRAB V1, V2, V3 // 4304ec70
VSRAH V1, V2, V3 // 4384ec70
VSRAW V1, V2, V3 // 4304ed70
VSRAV V1, V2, V3 // 4384ed70
VROTRB V1, V2, V3 // 4304ee70
VROTRH V1, V2, V3 // 4384ee70
VROTRW V1, V2, V3 // 4304ef70
VROTRV V1, V2, V3 // 4384ef70
XVSLLB X3, X2, X1 // 410ce874
XVSLLH X3, X2, X1 // 418ce874
XVSLLW X3, X2, X1 // 410ce974
XVSLLV X3, X2, X1 // 418ce974
XVSRLB X3, X2, X1 // 410cea74
XVSRLH X3, X2, X1 // 418cea74
XVSRLW X3, X2, X1 // 410ceb74
XVSRLV X3, X2, X1 // 418ceb74
XVSRAB X3, X2, X1 // 410cec74
XVSRAH X3, X2, X1 // 418cec74
XVSRAW X3, X2, X1 // 410ced74
XVSRAV X3, X2, X1 // 418ced74
XVROTRB X3, X2, X1 // 410cee74
XVROTRH X3, X2, X1 // 418cee74
XVROTRW X3, X2, X1 // 410cef74
XVROTRV X3, X2, X1 // 418cef74
VSLLB $0, V1, V2 // 22202c73
VSLLB $7, V1, V2 // 223c2c73
VSLLB $5, V1 // 21342c73
VSLLH $0, V1, V2 // 22402c73
VSLLH $15, V1, V2 // 227c2c73
VSLLH $10, V1 // 21682c73
VSLLW $0, V1, V2 // 22802c73
VSLLW $31, V1, V2 // 22fc2c73
VSLLW $11, V1 // 21ac2c73
VSLLV $0, V1, V2 // 22002d73
VSLLV $63, V1, V2 // 22fc2d73
VSLLV $30, V1 // 21782d73
VSRLB $0, V1, V2 // 22203073
VSRLB $7, V1, V2 // 223c3073
VSRLB $4, V1 // 21303073
VSRLH $0, V1, V2 // 22403073
VSRLH $15, V1, V2 // 227c3073
VSRLH $9, V1 // 21643073
VSRLW $0, V1, V2 // 22803073
VSRLW $31, V1, V2 // 22fc3073
VSRLW $16, V1 // 21c03073
VSRLV $0, V1, V2 // 22003173
VSRLV $63, V1, V2 // 22fc3173
VSRLV $40, V1 // 21a03173
VSRAB $0, V1, V2 // 22203473
VSRAB $7, V1, V2 // 223c3473
VSRAB $6, V1 // 21383473
VSRAH $0, V1, V2 // 22403473
VSRAH $15, V1, V2 // 227c3473
VSRAH $8, V1 // 21603473
VSRAW $0, V1, V2 // 22803473
VSRAW $31, V1, V2 // 22fc3473
VSRAW $12, V1 // 21b03473
VSRAV $0, V1, V2 // 22003573
VSRAV $63, V1, V2 // 22fc3573
VSRAV $50, V1 // 21c83573
VROTRB $0, V1, V2 // 2220a072
VROTRB $7, V1, V2 // 223ca072
VROTRB $3, V1 // 212ca072
VROTRH $0, V1, V2 // 2240a072
VROTRH $15, V1, V2 // 227ca072
VROTRH $5, V1 // 2154a072
VROTRW $0, V1, V2 // 2280a072
VROTRW $31, V1, V2 // 22fca072
VROTRW $18, V1 // 21c8a072
VROTRV $0, V1, V2 // 2200a172
VROTRV $63, V1, V2 // 22fca172
VROTRV $52, V1 // 21d0a172
XVSLLB $0, X2, X1 // 41202c77
XVSLLB $7, X2, X1 // 413c2c77
XVSLLB $4, X2 // 42302c77
XVSLLH $0, X2, X1 // 41402c77
XVSLLH $15, X2, X1 // 417c2c77
XVSLLH $8, X2 // 42602c77
XVSLLW $0, X2, X1 // 41802c77
XVSLLW $31, X2, X1 // 41fc2c77
XVSLLW $13, X2 // 42b42c77
XVSLLV $0, X2, X1 // 41002d77
XVSLLV $63, X2, X1 // 41fc2d77
XVSLLV $36, X2 // 42902d77
XVSRLB $0, X2, X1 // 41203077
XVSRLB $7, X2, X1 // 413c3077
XVSRLB $5, X2 // 42343077
XVSRLH $0, X2, X1 // 41403077
XVSRLH $15, X2, X1 // 417c3077
XVSRLH $9, X2 // 42643077
XVSRLW $0, X2, X1 // 41803077
XVSRLW $31, X2, X1 // 41fc3077
XVSRLW $14, X2 // 42b83077
XVSRLV $0, X2, X1 // 41003177
XVSRLV $63, X2, X1 // 41fc3177
XVSRLV $45, X2 // 42b43177
XVSRAB $0, X2, X1 // 41203477
XVSRAB $7, X2, X1 // 413c3477
XVSRAB $6, X2 // 42383477
XVSRAH $0, X2, X1 // 41403477
XVSRAH $15, X2, X1 // 417c3477
XVSRAH $10, X2 // 42683477
XVSRAW $0, X2, X1 // 41803477
XVSRAW $31, X2, X1 // 41fc3477
XVSRAW $16, X2 // 42c03477
XVSRAV $0, X2, X1 // 41003577
XVSRAV $63, X2, X1 // 41fc3577
XVSRAV $48, X2 // 42c03577
XVROTRB $0, X2, X1 // 4120a076
XVROTRB $7, X2, X1 // 413ca076
XVROTRB $3, X2 // 422ca076
XVROTRH $0, X2, X1 // 4140a076
XVROTRH $15, X2, X1 // 417ca076
XVROTRH $13, X2 // 4274a076
XVROTRW $0, X2, X1 // 4180a076
XVROTRW $31, X2, X1 // 41fca076
XVROTRW $24, X2 // 42e0a076
XVROTRV $0, X2, X1 // 4100a176
XVROTRV $63, X2, X1 // 41fca176
XVROTRV $52, X2 // 42d0a176

// [X]VADD{B,H,W,V,Q}, [X]VSUB{B,H,W,V,Q} instructions
VADDB V1, V2, V3 // 43040a70
VADDH V1, V2, V3 // 43840a70
VADDW V1, V2, V3 // 43040b70
VADDV V1, V2, V3 // 43840b70
VADDQ V1, V2, V3 // 43042d71
VSUBB V1, V2, V3 // 43040c70
VSUBH V1, V2, V3 // 43840c70
VSUBW V1, V2, V3 // 43040d70
VSUBV V1, V2, V3 // 43840d70
VSUBQ V1, V2, V3 // 43842d71
XVADDB X3, X2, X1 // 410c0a74
XVADDH X3, X2, X1 // 418c0a74
XVADDW X3, X2, X1 // 410c0b74
XVADDV X3, X2, X1 // 418c0b74
XVADDQ X3, X2, X1 // 410c2d75
XVSUBB X3, X2, X1 // 410c0c74
XVSUBH X3, X2, X1 // 418c0c74
XVSUBW X3, X2, X1 // 410c0d74
XVSUBV X3, X2, X1 // 418c0d74
XVSUBQ X3, X2, X1 // 418c2d75

// [X]VADD{B,H,W,V}U, [X]VSUB{B,H,W,V}U instructions
VADDBU $1, V2, V1 // 41048a72
VADDHU $2, V2, V1 // 41888a72
VADDWU $3, V2, V1 // 410c8b72
VADDVU $4, V2, V1 // 41908b72
VSUBBU $5, V2, V1 // 41148c72
VSUBHU $6, V2, V1 // 41988c72
VSUBWU $7, V2, V1 // 411c8d72
VSUBVU $8, V2, V1 // 41a08d72
XVADDBU $9, X1, X2 // 22248a76
XVADDHU $10, X1, X2 // 22a88a76
XVADDWU $11, X1, X2 // 222c8b76
XVADDVU $12, X1, X2 // 22b08b76
XVSUBBU $13, X1, X2 // 22348c76
XVSUBHU $14, X1, X2 // 22b88c76
XVSUBWU $15, X1, X2 // 223c8d76
XVSUBVU $16, X1, X2 // 22c08d76
6 changes: 5 additions & 1 deletion src/cmd/cgo/internal/test/issue4029.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package cgotest

/*
#include <stdint.h>
#include <stdlib.h>
#include <dlfcn.h>
#cgo linux LDFLAGS: -ldl
Expand All @@ -24,6 +25,7 @@ import "C"

import (
"testing"
"unsafe"
)

var callbacks int
Expand Down Expand Up @@ -66,7 +68,9 @@ func loadThySelf(t *testing.T, symbol string) {
}
defer C.dlclose4029(this_process)

symbol_address := C.dlsym4029(this_process, C.CString(symbol))
symCStr := C.CString(symbol)
defer C.free(unsafe.Pointer(symCStr))
symbol_address := C.dlsym4029(this_process, symCStr)
if symbol_address == 0 {
t.Error("dlsym:", C.GoString(C.dlerror()))
return
Expand Down
7 changes: 5 additions & 2 deletions src/cmd/cgo/internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@ func testErrno(t *testing.T) {
func testMultipleAssign(t *testing.T) {
p := C.CString("234")
n, m := C.strtol(p, nil, 345), C.strtol(p, nil, 10)
defer C.free(unsafe.Pointer(p))
if runtime.GOOS == "openbsd" {
// Bug in OpenBSD strtol(3) - base > 36 succeeds.
if (n != 0 && n != 239089) || m != 234 {
Expand All @@ -1106,7 +1107,6 @@ func testMultipleAssign(t *testing.T) {
} else if n != 0 || m != 234 {
t.Fatal("Strtol x2: ", n, m)
}
C.free(unsafe.Pointer(p))
}

var (
Expand Down Expand Up @@ -1632,7 +1632,9 @@ func testNaming(t *testing.T) {

func test6907(t *testing.T) {
want := "yarn"
if got := C.GoString(C.Issue6907CopyString(want)); got != want {
s := C.Issue6907CopyString(want)
defer C.free(unsafe.Pointer(s))
if got := C.GoString(s); got != want {
t.Errorf("C.GoString(C.Issue6907CopyString(%q)) == %q, want %q", want, got, want)
}
}
Expand Down Expand Up @@ -1881,6 +1883,7 @@ func test17537(t *testing.T) {
}

p := (*C.char)(C.malloc(1))
defer C.free(unsafe.Pointer(p))
*p = 17
if got, want := C.F17537(&p), C.int(17); got != want {
t.Errorf("got %d, want %d", got, want)
Expand Down
8 changes: 7 additions & 1 deletion src/cmd/cgo/internal/testsanitizers/cc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ func compilerRequiredAsanVersion(goos, goarch string) bool {
}
}

// compilerRequiredLsanVersion reports whether the compiler is the
// version required by Lsan.
func compilerRequiredLsanVersion(goos, goarch string) bool {
return compilerRequiredAsanVersion(goos, goarch)
}

type compilerCheck struct {
once sync.Once
err error
Expand Down Expand Up @@ -377,7 +383,7 @@ func configure(sanitizer string) *config {
c.ldFlags = append(c.ldFlags, "-fPIC", "-static-libtsan")
}

case "address":
case "address", "leak":
c.goFlags = append(c.goFlags, "-asan")
// Set the debug mode to print the C stack trace.
c.cFlags = append(c.cFlags, "-g")
Expand Down
Loading

0 comments on commit 7ff3071

Please sign in to comment.