67067 Commits

Author SHA1 Message Date
Mark Freeman
145001b82a cmd/export: implement a simple cmd/export tool
This tool is based on unitchecker. It accepts a configuration file that
describes a package for which to export type information. It loads the
package, parses it, type checks it, and writes out its export data in
indexed (i) format.

For #79427

Change-Id: Ia8ceb978fc1ba64feb606b03609c94d7298c1c38
Reviewed-on: https://go-review.googlesource.com/c/go/+/805500
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-29 11:16:03 -07:00
Ian Alexander
594b58aa32 net/url: avoid quadratic complexity in resolvePath
Operate on a []byte with index-based backtracking instead of calling
dst.String() and dst.WriteString() per iteration.

goos: linux
goarch: amd64
pkg: net/url
cpu: AMD EPYC 7B13
                      │   b/gotip    │               b/fixed               │
                      │    sec/op    │   sec/op     vs base                │
ResolvePath/Simple      123.85n ± 1%   94.56n ± 0%  -23.65% (p=0.000 n=10)
ResolvePath/Deep         1.819µ ± 1%   1.611µ ± 1%  -11.41% (p=0.000 n=10)
ResolvePath/Backtrack    6.439µ ± 2%   2.280µ ± 1%  -64.59% (p=0.000 n=10)
geomean                  1.132µ        702.9n       -37.90%

                      │   b/gotip   │              b/fixed               │
                      │    B/op     │    B/op     vs base                │
ResolvePath/Simple      16.000 ± 0%   4.000 ± 0%  -75.00% (p=0.000 n=10)
ResolvePath/Deep         712.0 ± 0%   624.0 ± 0%  -12.36% (p=0.000 n=10)
ResolvePath/Backtrack   9064.0 ± 0%   816.0 ± 0%  -91.00% (p=0.000 n=10)
geomean                  469.1        126.8       -72.98%

                      │   b/gotip    │              b/fixed               │
                      │  allocs/op   │ allocs/op   vs base                │
ResolvePath/Simple        2.000 ± 0%   1.000 ± 0%  -50.00% (p=0.000 n=10)
ResolvePath/Deep          7.000 ± 0%   3.000 ± 0%  -57.14% (p=0.000 n=10)
ResolvePath/Backtrack   107.000 ± 0%   3.000 ± 0%  -97.20% (p=0.000 n=10)
geomean                   11.44        2.080       -81.82%

Fixes #80494
Fixes CVE-2026-56860

Change-Id: I0aada41a0a10e2ce77c6476a65a49abc796dff3f
Reviewed-on: https://go-review.googlesource.com/c/go/+/803681
Reviewed-by: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-29 09:47:33 -07:00
Ian Alexander
ccb0514cb7 encoding/xml: fix depth processing in (*Decoder).unmarshal
(*Decoder).DecodeElement bypassed recursion depth guard by unilaterally
passing the constant 0 to (*Decoder).unmarshal. Previously, unmarshal
depth was tracked via a depth parameter passed down the call stack,
which manual loops inside custom UnmarshalXML methods could bypass.

This change simplifies depth tracking by maintaining a stack depth value
that is adjusted as start elements are pushed / popped. This eliminates
the need to reason about and synchronize two different values storing
the unmarshal depth.

Additionally, guarding (*Decoder).RawToken using parser stack state
broke streaming decoders reading tokens within open XML elements. This
change simplifies the guard by adding an explicit inUnmarshalXML flag.

Thanks to Moran Omer (GitHub: moraneus) for reporting this issue.

Fixes #80481
Fixes CVE-2026-56859

Change-Id: I5e89ebe9101b03545520aba5ea99fbf15bdf0395
Reviewed-on: https://go-review.googlesource.com/c/go/+/803320
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-29 09:32:44 -07:00
Filippo Valsorda
d2bb10c89e crypto/tls: add fips140ems GODEBUG setting to disable EMS enforcement
FIPS 140-3 mode requires EMS in TLS 1.2. Unfortunately, some deployments
don't support EMS still, and have audit exemptions for it, but not for
turning off FIPS 140-3 mode entirely.

Add a GODEBUG to disable enforcement. There is no change of default
behavior, the GODEBUG is off by default.

Fixes #80516

Change-Id: If93e2c1ea70dc5f34bcf7285549837576a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804062
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-07-29 09:25:28 -07:00
Ilya Torbin
b7f9e52865 go/types: use range over typeset in sliceExpr
CL 688876 made typeset return an iterator and converted the types2
version of this code to a range loop, but left the go/types copy in
the explicit closure-invocation form with a TODO, as go1.23 could not
be assumed at the time. That constraint is gone and the rest of the
package already ranges over typeset, so convert this last call,
bringing sliceExpr back in sync with types2.

Change-Id: Ie68b01bb5f817b37a4ee97d05d2e75f81aa45270
Reviewed-on: https://go-review.googlesource.com/c/go/+/805720
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Putman <aputman@golang.org>
2026-07-29 07:11:32 -07:00
Jorropo
a595f29385 cmd/compile: fix time traveling proofs in prove
So we had an issue with some of the slices proofs.
They ran in addLocalFacts which learned all values's proofs.

The problem is that some proofs are only valid after
executing certain values.
This happens when a value adds relations in the factsTable
about exclusively the value's arguments.

But due to the descend / simplify separation simplify would run
with all the proofs of the whole block.

This CL include a huge amount of retabulation of code,
all the meaningfull part is the changes to the prove function.

Now we run:
1. flowLimit
2. constantFoldArguments
3. addValueFact
4. simplifyValue

inside the same value loop.

So thanks to toposorting, facts are learned in a valid execution order.
And thanks to interleaving simplify for value v can only see v's facts.

Fixes #80517

Change-Id: I36f5bce5102df55a9e5eca400dfd931c46323d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/804220
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-28 17:00:28 -07:00
ArsenySamoylov
3e6eb83f95 cmd/compile: pair NEON loads/stores
Change-Id: Id12674ae56af4c3610f1e18a6d85d169a784dcca
Reviewed-on: https://go-review.googlesource.com/c/go/+/787301
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Denis Melnikov <melnikov.denis.aleksandrovich@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-28 13:53:16 -07:00
Nicholas S. Husin
2742057184 crypto/tls: do not count handshake messages as state-advancing post-handshake
Previously, we always counted handshake messages, such as KeyUpdate, as
state-advancing, regardless of whether a handshake has been completed or
not. As a result, a malicious client can keep sending KeyUpdate messages
to force the server to keep performing key derivation operations
indefinitely.

Fix the issue by making it so that handshake messages are regarded
as state-advancing only prior to handshake completion.

Thank you to Qi Deng of Aurascape.ai for reporting this issue.

Fixes #79866
Fixes #80528
Fixes CVE-2026-56862

Change-Id: I37d27fd5f16227a9dde5f29bb5ae6c436a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804261
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Neal Patel <neal@golang.org>
2026-07-28 11:52:21 -07:00
Gilbert Morgan
ee64db65cf cmd/compile: generalize staticuint64s sharing to larger integer constant types
Optimize interface conversion of small integer constants of any size
(values in range [0, 255]) by redirecting their references to direct
offsets into runtime.staticuint64s during the walk lowering phase.

This avoids generating redundant static temporary backing variables
(stmp symbols) in the read-only data segment, allowing the linker's
dead-code elimination pass to discard them.

Consolidate the compile-time constant lookup with the dynamic size-1
variable path into a single switch case block in dataWord(),
preserving the evaluation order of expressions with side effects.

Fixes #37612

Change-Id: I81bd20bc4e98f690aad67804e23b104dfe2a6ed8
Reviewed-on: https://go-review.googlesource.com/c/go/+/802320
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-28 11:33:04 -07:00
Filippo Valsorda
591ed42daf crypto/ecdsa: avoid panic when Sign is called with crypto.Hash(0)
Change-Id: Ie29e0bae751617fdae75f6ad67e5f2d66a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804160
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-07-28 10:48:46 -07:00
xiajun ni
dd612356d8 cmd/compile: initialize large static offsets dynamically
LSym writes only support offsets below 1 GiB. Static initialization can
currently send larger offsets to the object writer, exposing an internal
prepwrite diagnostic.

Move values that cannot fit in static data to the existing dynamic
initialization path. Check array and struct entries individually so
sparse aggregate literals remain supported, and share the offset limit
with cmd/internal/obj.

Fixes #78974

Change-Id: I9c0bc0520ee801664469d15fd6007131c0d79e49
Reviewed-on: https://go-review.googlesource.com/c/go/+/804780
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-27 16:22:23 -07:00
Egon Elbre
5de5a2ec8a cmd/compile/internal/ssa: strip redundant byte/halfword zero-extensions on arm64
Unsigned narrow compares lower to a compare of zero-extended operands
(Less8U => LessThanU (CMPW (MOVBUreg x) (MOVBUreg y))). When the operand
is already a zero-extended narrow load, late lower rewrites the
extension to MOVDreg, which is elided only when the load has a single
use. When the loaded value has a second consumer -- e.g. it is also a
table index, the escapeASCII[c] shape in every scanner -- a real
MOVD Rx,Ry copy survives purely to feed the compare.

Extend the existing MOVWUreg/ZeroUpper32Bits late-lower rule to bytes
and halfwords: when the argument of MOVBUreg/MOVHUreg provably already
has its upper 56/48 bits clear, replace the extension with its argument
at all uses.

In jsonwire.NeedEscape:

    MOVBU (R0)(R3), R4          // c = src[i]
  - MOVD  R4, R5                // redundant copy
  - TBNZ  $7, R5, ...           // c >= utf8.RuneSelf
  + TBNZ  $7, R4, ...           // c >= utf8.RuneSelf
    MOVD  $escapeASCII(SB), R5
    MOVBU (R5)(R4), R4          // escapeASCII[c]

This removes a net 1182 register copies in std at GOARCH=arm64 with no
per-package regression (runtime -88, internal/trace -84,
x/text/unicode/norm -66, crypto/tls -53, html/template -47,
compress/flate -42), for -5168 bytes of function text across std.

Updates #43357

Change-Id: Icab5182c6b4dd7bca8a0956fa9b2135604b883a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/804064
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-07-27 15:03:58 -07:00
Egon Elbre
197b975aee cmd/compile/internal/ssa: lower byte compare against 128 to TBNZ/TBZ on arm64
The ASCII fast path that every Go scanner runs — c := b[i]; if c >=
utf8.RuneSelf — lowers on arm64 to MOVBU; CMPW $128; B.HS: a
compare-and-branch where a single bit test would do.

Because c is loaded by a zero-extended byte op it is provably in
[0,255], and for a value below 2^8 the test c >=u 128 is exactly "bit 7
set" (and c <u 128 is "bit 7 clear"). So the compare and its unsigned
branch collapse to one TBNZ/TBZ $7, dropping the CMPW.

Change-Id: Ia2821f74865b23cd1b8db695b152eb139ac9994b
Reviewed-on: https://go-review.googlesource.com/c/go/+/804063
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-27 15:02:23 -07:00
Michael Matloob
4e78285557 cmd/compile/internal/ssa/_gen: disallow op variable name
We're reserving this so that 'op' can now be used for the import of the op
package we're adding without having to rename the import. Rename the variables
in generic.rules that use the op name to use op1 and regenerate.

For #80409

Change-Id: I8501c1cc3f3763a4890e8453b48452b76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/803780
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-27 14:18:01 -07:00
dorbmon
63741eaa9e strings, bytes: speed up TrimSpace for Unicode input
Avoid the generic TrimFunc fallback in TrimSpace after encountering
non-ASCII input. Instead, use dedicated Unicode whitespace trimming
helpers backed by a small internal White_Space predicate.

This keeps the existing ASCII fast path unchanged while avoiding
function predicate calls and general Unicode range table lookups on
the Unicode trimming path.

On linux/amd64, using benchstat over 10 runs:

goos: linux
goarch: amd64
pkg: bytes
cpu: Intel(R) Core(TM) i7-14700KF
                          │   old.txt   │               new.txt               │
                          │   sec/op    │   sec/op     vs base                │
TrimSpace/NoTrim-20         1.521n ± 0%   1.510n ± 1%   -0.72% (p=0.002 n=10)
TrimSpace/ASCII-20          2.438n ± 1%   2.421n ± 1%        ~ (p=0.159 n=10)
TrimSpace/SomeNonASCII-20   46.03n ± 1%   23.33n ± 2%  -49.30% (p=0.000 n=10)
TrimSpace/JustNonASCII-20   62.03n ± 1%   28.80n ± 1%  -53.57% (p=0.000 n=10)
geomean                     10.14n        7.040n       -30.60%

pkg: strings
                          │   old.txt   │               new.txt               │
                          │   sec/op    │   sec/op     vs base                │
TrimSpace/NoTrim-20         1.540n ± 1%   1.528n ± 1%        ~ (p=0.171 n=10)
TrimSpace/ASCII-20          2.258n ± 6%   2.250n ± 0%        ~ (p=0.254 n=10)
TrimSpace/SomeNonASCII-20   48.08n ± 1%   21.18n ± 1%  -55.96% (p=0.000 n=10)
TrimSpace/JustNonASCII-20   59.97n ± 0%   27.85n ± 1%  -53.56% (p=0.000 n=10)
geomean                     10.01n        6.711n       -32.94%

All cases remain at 0 B/op and 0 allocs/op.

Add a test to keep the internal predicate in sync with unicode.IsSpace.

Change-Id: I4fc0cff5808169b562e156eafa038450c2fe2d50
Reviewed-on: https://go-review.googlesource.com/c/go/+/793620
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-27 09:49:37 -07:00
Filippo Valsorda
946c134477 crypto/internal/fips140test: add browser bridge for Wasm testing
Change-Id: I9cd4abcc0e2bd476a14084d52b64a13b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/805240
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-07-27 09:15:19 -07:00
Ahmed Mohamed
af26c13f95 runtime, cmd/compile: increase string temp buffer to 64 bytes
The compiler passes a fixed-size stack buffer to the string
concatenation and []byte/[]rune->string conversion runtime helpers
when the result does not escape, avoiding a heap allocation when the
result fits. That buffer has been 32 bytes, with a comment noting
there is no fundamental theory behind the number.

Instrumenting real workloads (the compiler compiling std, and the
net/http, net/url, os, path/filepath and encoding/json test and
benchmark suites) shows that 21% to 37% of stack-eligible string
concatenations, and 27% to 53% of []byte->string conversions,
produce results in the 33-64 byte range that spill to the heap at 32
bytes but fit at 64.

Raise the buffer to 64 bytes. A non-escaping concatenation frame
grows by 32 bytes; results up to 32 bytes are unchanged and results
above 64 bytes still allocate.

The same 32-byte constant was also used for the string->[]rune
buffer, where elements are 4 bytes wide and exceeding 32 runes is
rare, so a larger buffer would grow those frames (by 128 bytes) for
almost no benefit. Split it into a separate tmpRuneBufSize constant
kept at 32 so the rune path is unaffected.

Updates #75441

Change-Id: I063229764f679c43c98c52d24d4167c9f2d7c5e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/800780
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-27 09:15:03 -07:00
Jorropo
395f4f5e3f cmd/compile: fix prove to generate Const64 for 64bits slicemasks
Fixes #79874

Change-Id: I155b6571db5b3c3537c549eadfe87a14b7d5836a
Reviewed-on: https://go-review.googlesource.com/c/go/+/787720
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-07-27 09:14:53 -07:00
Jorropo
1008f900f6 cmd/compile: ssa rewrite x-(x&y) => x&^y
This allows to rewrite:
  AND BX, AX
  SUB AX, BX

Into (with GOAMD64=v3):
  ANDN AX, BX, AX

Which is twice as fast, and smaller.

Into (without GOAMD64=v3):
  NOT BX
  AND AX, BX

Which if AX's dependency isn't resolved yet but BX is in most cases twice as
fast because now the NOT BX and AX's depency can execute in parallel.
In other cases, it has negligible positive impact.

Other instructions set will also benefit from the pipelining advantage
And also benefit from the smaller ANDN instruction if they have something
similar.

Help reduce ChaCha20 and Poly1305 to #52563

Change-Id: I0a0a3fe553b857e13c61fbf52f9765377615a898
Reviewed-on: https://go-review.googlesource.com/c/go/+/786700
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-07-27 09:14:47 -07:00
Julian Zhu
e798729d8c cmd/compile: simplify memory load and store operations on mips
If the memory load and store operations use the same ptr, they are
combined into a direct move operation between registers, like riscv64.

Change-Id: I0788b0f49949e3205c15bcbe6516afbce83cf2dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/704656
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-27 09:14:28 -07:00
Julian Zhu
bcd794d277 cmd/compile: simplify memory load and store operations on mips64
If the memory load and store operations use the same ptr, they are
combined into a direct move operation between registers, like riscv64.

Change-Id: I496b6fb7e5897955263f16c91e360205190de8fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/704655
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-27 09:14:24 -07:00
Alan Donovan
d1c1356637 cmd/vet: fix misspelled analyzer name in test
(See CL 804960.)

Change-Id: Ie8ca868fb57283846164cceb4810e8eb9101f7f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/805800
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-07-26 21:47:10 -07:00
Jakub Ciolek
6e88b3b4b6 cmd/compile: order functions by IR node count
Count nodes during the existing pre-walk traversal and use that
count instead of the number of top-level statements when ordering
functions for compilation.

compilebench Intel Alder Lake 12600k (P cores):

                         │ /home/jake/26jul/costmodel.master │   /home/jake/26jul/costmodel.new    │
                         │              sec/op               │   sec/op     vs base                │
Template                                         87.92m ± 1%   88.16m ± 1%        ~ (p=0.341 n=20)
Unicode                                          61.10m ± 1%   61.17m ± 1%        ~ (p=0.429 n=20)
GoTypes                                          544.1m ± 0%   542.9m ± 1%   -0.23% (p=0.046 n=20)
Compiler                                         83.30m ± 1%   81.97m ± 1%   -1.60% (p=0.000 n=20)
SSA                                               5.170 ± 0%    5.061 ± 0%   -2.11% (p=0.000 n=20)
Flate                                            95.04m ± 0%   94.80m ± 0%        ~ (p=0.192 n=20)
GoParser                                         96.25m ± 0%   84.29m ± 1%  -12.43% (p=0.000 n=20)
Reflect                                          229.2m ± 0%   227.6m ± 1%   -0.69% (p=0.000 n=20)
Tar                                             100.23m ± 1%   99.12m ± 0%   -1.11% (p=0.000 n=20)
XML                                              114.7m ± 1%   113.3m ± 0%   -1.29% (p=0.000 n=20)
LinkCompiler                                     286.8m ± 1%   285.6m ± 1%        ~ (p=0.820 n=20)
ExternalLinkCompiler                             760.9m ± 0%   760.8m ± 0%        ~ (p=0.841 n=20)
LinkWithoutDebugCompiler                         182.8m ± 1%   179.5m ± 1%   -1.83% (p=0.000 n=20)
StdCmd                                            36.82 ± 0%    36.60 ± 0%   -0.61% (p=0.001 n=20)
geomean                                          298.5m        293.6m        -1.63%

                         │ /home/jake/26jul/costmodel.master │   /home/jake/26jul/costmodel.new   │
                         │            user-sec/op            │ user-sec/op  vs base               │
Template                                         225.9m ± 1%   225.2m ± 2%       ~ (p=0.846 n=20)
Unicode                                          67.70m ± 4%   67.59m ± 4%       ~ (p=0.841 n=20)
GoTypes                                           1.791 ± 1%    1.775 ± 1%  -0.87% (p=0.038 n=20)
Compiler                                         164.4m ± 2%   163.8m ± 2%       ~ (p=0.142 n=20)
SSA                                               17.56 ± 1%    17.63 ± 1%       ~ (p=0.989 n=20)
Flate                                            269.2m ± 2%   270.1m ± 1%       ~ (p=0.738 n=20)
GoParser                                         232.4m ± 2%   232.0m ± 2%       ~ (p=0.779 n=20)
Reflect                                          644.1m ± 1%   642.5m ± 0%       ~ (p=0.547 n=20)
Tar                                              267.3m ± 1%   261.6m ± 1%  -2.13% (p=0.000 n=20)
XML                                              313.7m ± 1%   304.0m ± 1%  -3.11% (p=0.000 n=20)
LinkCompiler                                     462.1m ± 1%   468.6m ± 1%  +1.41% (p=0.013 n=20)
ExternalLinkCompiler                             848.9m ± 1%   846.6m ± 1%       ~ (p=0.779 n=20)
LinkWithoutDebugCompiler                         213.1m ± 2%   213.3m ± 2%       ~ (p=0.429 n=20)
geomean                                          438.7m        436.9m       -0.43%

Change-Id: I0389d056d5759117b768881f8ac1697f6cab366a
Reviewed-on: https://go-review.googlesource.com/c/go/+/802361
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2026-07-26 14:21:14 -07:00
Jorropo
6db72bb92b cmd/compile: remove HI LO mips support from regalloc
This is a plain lie but the alternative would be to
make HI LO incompatible with load store and spilling
but this requires a register allocator for the register allocator,
which would be complex and low ROI.

Change-Id: Idf53dc619bcf40afcdac5142efa7f6f43b63a9df
Reviewed-on: https://go-review.googlesource.com/c/go/+/805460
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-25 06:25:00 -07:00
Jorropo
af4b02c461 cmd/compile: do not home mul/div results in HI/LO
On mips and mips64, multiply/divide results were tuple outputs in the
special HI/LO registers, and regalloc kept live values homed there.
Spilling such a value must route the data through REGTMP (there is no
direct store from HI/LO). When the stack frame is too large for a
16-bit offset, the assembler also materializes the spill slot address
in REGTMP:

	MOVV	LO, R23
	LUI	R23, $1
	DADDU	R23, R23, SP
	SD	R23, off(R23)

clobbering the value and silently storing SP+0x10000 instead.

Instead, make MULV/MULVU/DIVV/DIVVU (mips64) and MULT/MULTU/DIV/DIVU
(mips) produce their results in two general registers, moving out of
HI and LO as part of the op itself.

Since register-register moves do not depend on REGTMP it can't get
the dual use bug.

Fixes #80563

Change-Id: I2a0cb5ec7103ab2b0cbbeb67edd38ff5cb33bf77
Reviewed-on: https://go-review.googlesource.com/c/go/+/805420
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
2026-07-25 06:24:58 -07:00
ArsenySamoylov
7b4aab82eb internal/strconv: remove stale comment after CL 714161
Change-Id: If3392a2d4bf5acc6896d39aa8a24d8b3db2b8b88
Reviewed-on: https://go-review.googlesource.com/c/go/+/804880
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-24 20:27:52 -07:00
Hana Kim
a961f702a4 cmd/go/internal/doc: update pkgsite version
This picks up the fix for encoding/json package documentation.
(CL 803941)

Fixes golang/go#80556

Change-Id: I3bc17f4d5905a27a4228f2ca2a8816b044fe9a97
Reviewed-on: https://go-review.googlesource.com/c/go/+/804661
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com>
2026-07-24 14:36:24 -07:00
Alan Donovan
a3b0982e18 cmd/vet: update TestVet to cover all analyzers in vet.Suite
The intent of this test was a minimal integration test
of each analyzer, but we have added many over the years
without tests. This CL ensures that the tests exhaustively
cover all the analyzers, and adds minimal missing tests.

Many of the existing tests were renamed to match the analyzer
name exactly. The loopclosure test was deleted in accordance
with the TODO.

This CL also uses proper Go string literal parsing in // ERROR
comments instead of the hackish old logic derived from the
Go compiler.

Change-Id: Ie488fbb525d76f02dfea1a43008208db43d438f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/804960
Reviewed-by: Alex Putman <aputman@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-24 14:26:50 -07:00
Alan Donovan
f0dbb9bd0b cmd: update x/tools to master
go get golang.org/x/tools@master
go mod vendor
go mod tidy
go generate cmd/go/internal/test

Also, fix a handful of uses of Scanner that triggered
a diagnostic from the newly imported vet check.

+ relnotes for new vet checks

Fixes #17747

Change-Id: I06f480ce9a11b23add59f578763bcc76730d5fb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/804522
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2026-07-24 11:48:31 -07:00
Meng Zhuo
0b02c60612 cmd/asm, cmd/internal/obj: add crypto algorithm suites for riscv64
Adds crypto algorithm suites' intrinsic encoding and testcase:

* Zvkg - Vector GCM/GMAC
* Zvkned - NIST Suite: Vector AES Block Cipher
* Zvknh[ab] - NIST Suite: Vector SHA-2 Secure Hash
* Zvksed - ShangMi Suite: SM4 Block Cipher
* Zvksh - ShangMi Suite: SM3 Secure Hash

Updates #77328

Change-Id: I0d841cce0fd734c28e409d6b6edbcfdc0c7da9d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/664155
Reviewed-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-07-23 17:34:56 -07:00
Damien Neil
ca4a27f0b1 net/http: rework HTTP/3 registration to allow using a fake network
This is the net/http half of a paired set of changes which modify
the mechanism by which x/net/http3 integrates with net/http.
The other half of the change is CL 801940. See that CL for a more
in-depth description of the change.

This change drops support for HTTP/3 in ListenAndServeTLS (for now).
Tests use ServeTLS instead.

Change-Id: If6fcea4be6638a4670477c6472e480476a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/803380
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2026-07-23 14:42:35 -07:00
Michael Matloob
325f9a9e91 cmd/go/internal/modload: remove state manipulation functions
Remove setState, EnterWorkspace, and Reset from the moudle loader. They're no
longer necessary because we can just create new loaders with jitsu's work
removing the use of global state!

Change-Id: I93146f3692a5d3077a6d8913d7ff501d6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/801340
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Ian Alexander <jitsu@google.com>
2026-07-23 14:32:43 -07:00
Ian Alexander
70b963a5c7 cmd/go/internal/base: small modernizations
Change-Id: Ic107cd924ded4eac13215d1dde9c7db37d6c2ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/763662
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
2026-07-23 14:27:09 -07:00
Ian Alexander
f05f3cdd21 cmd/go/internal/modload: remove unused parameters
Change-Id: I39f33fe55efb649e10fbd39c642c2504fca89a52
Reviewed-on: https://go-review.googlesource.com/c/go/+/763661
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2026-07-23 14:26:47 -07:00
Ian Alexander
4fb25ce6c5 cmd/go/internal/modload: use tagged switch
Change-Id: Ia594062a785fba2776954c5bf5fbe92358724aec
Reviewed-on: https://go-review.googlesource.com/c/go/+/763660
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-23 14:26:15 -07:00
Ian Alexander
626cc8d64a cmd/go/internal/modload: omit type in declaration
The type can be inferred from the right hand side of the expression.

Change-Id: Ib10889f4be1db2c48162d643b20765267b618cfa
Reviewed-on: https://go-review.googlesource.com/c/go/+/763621
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2026-07-23 14:25:15 -07:00
Damien Neil
479772fe59 net/http: consistent port stripping when setting expected TLS ServerName
New client TLS connections set the tls.Config.ServerName field to verify
the hostname on the peer's certificate.

The name is the peer's address, minus the port.

We used different port stripping implementations when stripping the
port from a request target, and from a proxy. Consistently use
net.SplitHostPort in both paths.

Change-Id: Iaa2b06b3182d231503b0f1247bb232236a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/803340
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
2026-07-23 13:55:54 -07:00
Ilya Torbin
80a6dffae3 cmd/cover: use Scanner.End for token end positions
Now that go/scanner has an End method (accepted in #74958), the
range-building code can use it directly instead of estimating a
token's end position from pos+len(lit). The estimate was inaccurate
for raw string literals, whose lit value has carriage returns
stripped; Scanner.End reflects the true source offset.

Updates #74958.

Change-Id: I573bd039585d699cc1aeb325b749c422c874a097
Reviewed-on: https://go-review.googlesource.com/c/go/+/802144
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-07-23 12:29:55 -07:00
cuishuang
543ead71a8 os/exec: make the Cmd.Start example runnable in the playground
The Cmd.Start example runs sleep for five seconds, which exceeds the
playground execution timeout when the example is run from pkg.go.dev.

Use echo instead. This keeps the example focused on the Start and Wait
workflow while allowing it to complete within the playground timeout.

Fixes #80236

Change-Id: I2fabac10fd0bb7b00af7473b957802b8f3afb644
Reviewed-on: https://go-review.googlesource.com/c/go/+/800120
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2026-07-23 08:21:46 -07:00
Inada Naoki
ef032c2be4 database/sql/driver: fix Rows.Next() comment
CL 89936 introduced restriction that Rows.Close() shouldn't modify dest
in previous Next().
CL 497675 for #60304 removed that restriction. But it didn't remove doc
about the restriction.

Change-Id: Idc0f16462fba4d2013ec069d251b8ebffbc4bdd1
GitHub-Last-Rev: f37493acd7aa3ad7863ad9c29b41290ad557d9cd
GitHub-Pull-Request: golang/go#73632
Reviewed-on: https://go-review.googlesource.com/c/go/+/670895
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-07-23 08:06:28 -07:00
carrerasdarren-cell
b590fd1075 cmd/compile: truncate uint64 indices for imm8 jump tables
Variable uint64 arguments lowered through immJumpTable were converted
directly to uintptr. Since the generated table has 256 entries, values
above 255 could dispatch outside the table and corrupt control flow. With
-spectre=ret, the binary-search fallback instead selected case 255,
differing from constant lowering.

Convert uint64 indices to uint8 before either dispatch path, matching
imm8 constant encoding. Extend the ShiftAllRightConcatMod32 tests through
the first out-of-range value.

Tests:

- GOEXPERIMENT=simd ./bin/go test simd/...
- GOEXPERIMENT=simd ./bin/go test -short cmd/compile/...
- GOEXPERIMENT=simd ./bin/go vet cmd/compile/internal/ssagen simd/...
- linux/amd64 PoC, ordinary and -spectre=ret dispatch

Fixes #80522.

Change-Id: I4a663f91c561e8212509b155e10acfc7245a59a1
GitHub-Last-Rev: 18cbbde1817affdce75d96be0a10ec908e0a785a
GitHub-Pull-Request: golang/go#80526
Reviewed-on: https://go-review.googlesource.com/c/go/+/803273
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-23 08:01:30 -07:00
cuishuang
cfa7d06396 simd: make function comment match function name
Change-Id: Ia474eb19df92cfdb4122564a87a9837b4ff03348
Reviewed-on: https://go-review.googlesource.com/c/go/+/797120
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-07-23 07:56:00 -07:00
Filippo Valsorda
e88582c5e1 crypto/tls: reject known extensions in disallowed handshake messages
Change-Id: I9f3d9f3575359fb4730e0fb278d2d6a16a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804180
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
2026-07-23 07:48:21 -07:00
Klaus Post
5a957dc766 internal/fuzz: fix race between context deadline and error suppression
When the coordinator's context deadline expires, there is a brief
window where ctx.Err() is set but fuzzCtx (a child context) has not
yet been canceled. If the coordinator's event loop observes <-doneC
during this window, the stop function compares the error against
fuzzCtx.Err() which is still nil, so the deadline error is not
suppressed and leaks out as a spurious test failure.

Fix this by also comparing against ctx.Err() in the suppression check.
ctx.Err() is guaranteed to be set before ctx.Done() is closed because
cancelCtx.cancel stores the error before closing the done channel.

Fixes #75804

Change-Id: I5262227c80b98387471a22e3cb8fe8491057e51e
GitHub-Last-Rev: a99ddf64fe05a99952516050c379673ed278a6f9
GitHub-Pull-Request: golang/go#79199
Reviewed-on: https://go-review.googlesource.com/c/go/+/774140
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-23 07:47:46 -07:00
David Chase
bef396c339 cmd/compile: add '-d=ssa/phase/@keyword=value' option
This is intended to simplify tuning and experiments.

Change-Id: I8ec2245b868fe4d508df1bc880c69568c90d8f93
Reviewed-on: https://go-review.googlesource.com/c/go/+/803700
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-07-22 18:53:39 -07:00
Sean Liao
9c0ab29165 cmd/go/internal/cfg: test GOAMD64 propagation using impossible value
Unlike what CL 778622 assumed, the default for cmd/go is
whatever was set at the time of make.bash, not amd64.v1.
To test this properly, use a value that's higher than
what will reasonably be set.

Updates #73294
Fixes #80525

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-goamd64v3
Change-Id: Ia8f9b9871ee9886201fa0a129c05a3636a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804060
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-07-22 15:01:55 -07:00
Cuong Manh Le
b4e7afa4c6 test: add regression test for go.dev/issue/80520
The issue was fixed unintentionally by CL 767161.

Fixes #80520

Change-Id: I212af69f0d7ccdc8e48f9a17e207de57be85e9e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/804280
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-07-22 14:36:18 -07:00
Keith Randall
3a171a2aca cmd/compile: fix mergelocals on mips/mips64
Change-Id: Ibc7526823677cf8aa3769e79676b18d3a56dfd01
Reviewed-on: https://go-review.googlesource.com/c/go/+/803274
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-07-22 14:36:07 -07:00
Nicholas S. Husin
9145bdabf8 crypto/tls: avoid overflow in parseECHConfigList
When parsing an ECHConfigList, length fields were previously evaluated
as a uint16. This would cause an infinite loop to occur when parsing a
65532 bytes long ECHConfig with a declared outer length header of 0.

Triggering this condition requires a payload of at least 65538 bytes. As
ECHConfigList payloads are typically delivered via protocols that limit
them to 65535 bytes (DNS HTTPS records and TLS extensions), regular
clients are safe from this issue.

Thank you to Nguyễn Hoàng Hải (facebookmark2022@gmail.com) for reporting
this issue.

Fixes #80513

Change-Id: I8c5011d3b375c24794dd38b915bb4dc06a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/804040
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-07-22 11:18:40 -07:00
khr@golang.org
5d5c7ff1f0 cmd/compile: fix mergelocals for arm32/s390x/riscv64
LoweredZero on arm32 and s390x also take an end-of-zero-range
address. That input is also an address sink.

Also allow propagation of addresses from input to output of a value,
so that we handle at least simple address arithmetic. This is required
to fix riscv64 because it has no indexed load/store, and thus does
a bunch more explicit address arithmetic than other archs.

Fixes #80484

Change-Id: I126eec1e2cc6c2ab5a39611ccc4d3371dca28292
Reviewed-on: https://go-review.googlesource.com/c/go/+/803660
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
2026-07-22 09:47:51 -07:00