$ the-wire · showcase
Nil-safety in go/types, faster flate, AES decrypt on loong64
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
A quiet toolchain day: the compiler's type API is being hardened against nil types that crashed gopls and linters, while compress/flate and loong64 AES pick up targeted speedups and golang/sys fills in Linux and BSD platform gaps.
types2, go/types: prevent nil types in published packages golang/go
Syntax errors, broken import cycles, and unresolved types could leave Object.Type(), Alias.fromRHS, Named.fromRHS, or TypeParam.bound returning nil, and tools traversing the published package graph (gopls, objectpath, linters) would panic dereferencing it. Accessor methods now enforce defined behavior for incomplete types instead of handing out nil.
compress/flate: speed up writeTokens golang/go
The token writing loop now flushes whole bytes from the bit accumulator unconditionally each iteration rather than testing after every code whether 48 bits had built up. That old test was a data-dependent branch the predictor handled poorly; the replacement store, shift, and add are branch free, and at most seven bits are pending at the top of an iteration.
runtime: use the static type of cleanup arguments golang/go
AddCleanup resolved its argument layout via abi.TypeOf(arg), which returns the dynamic type for an interface and nil for a nil interface, so the following Kind call panicked. On 32-bit platforms an interface also fits under maxTinySize, so a pointer-free dynamic type could box a data-carrying interface as noscan storage.
crypto/internal/fips140/aes: avoid per-round byte-swap in AES decrypt on loong64 golang/go
decryptBlockAsm byte-swapped every round key with VSHUFB on each round before use; because dec[] is a loong64-internal format, expandKeyAsm now stores all dec[] round key groups pre-swapped in state byte order, including the boundary groups that skip InvMixColumns. enc[] stays as is, since the generic GCM implementation consumes it via EncryptionKeySchedule.
unix: pass xattr data as unsafe.Pointer in BSD xattr syscalls golang/sys
The xattr functions on FreeBSD and NetBSD converted their data buffer pointer to uintptr before the call, which is only safe inside the call expression itself; GC could otherwise free or move the buffer while the syscall was still reading it. Unexported extattr* funcs now take the data argument as unsafe.Pointer, and the remaining golang/sys changes are quieter: Mmsghdr plus SizeofMmsghdr expos...