Commit b625939c65 for golang

commit b625939c651615d921e9d361abbc7554a47dfa5e
Author: Keith Randall <khr@golang.org>
Date:   Wed Dec 2 14:00:01 2026 -0800

    reflect: zero both words when calling Set with a nil interface

    A set of an interface type, with a nil interface, should set both
    words to zero. Previously we were only setting the first word to zero,
    because the result from assignTo wasn't setting flagIndir. Set that,
    and use the all-zero buffer as the source.

    Fixes #83573

    Change-Id: I1f5b41278dff4dcaa5d41a01349b2c36af4078cd
    Reviewed-on: https://go-review.googlesource.com/c/go/+/869362
    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: David Chase <drchase@google.com>
    Reviewed-by: Keith Randall <khr@google.com>
    Reviewed-by: Ian Lance Taylor <iant@golang.org>

diff --git a/src/reflect/value.go b/src/reflect/value.go
index be6b96a434..b33e2b98fd 100644
--- a/src/reflect/value.go
+++ b/src/reflect/value.go
@@ -3172,10 +3172,10 @@ func (v Value) assignTo(context string, dst *abi.Type, target unsafe.Pointer) Va

 	case implements(dst, v.typ()):
 		if v.Kind() == Interface && v.IsNil() {
-			// A nil ReadWriter passed to nil Reader is OK,
+			// A nil ReadWriter assigned to a Reader is OK,
 			// but using ifaceE2I below will panic.
-			// Avoid the panic by returning a nil dst (e.g., Reader) explicitly.
-			return Value{dst, nil, flag(Interface)}
+			// Avoid the panic by returning a nil interface of type dst (e.g., Reader) explicitly.
+			return Value{dst, unsafe.Pointer(&zeroVal), flagIndir | flag(Interface)}
 		}
 		x := valueInterface(v, false)
 		if target == nil {
diff --git a/test/fixedbugs/issue83573.go b/test/fixedbugs/issue83573.go
new file mode 100644
index 0000000000..9a58d96c39
--- /dev/null
+++ b/test/fixedbugs/issue83573.go
@@ -0,0 +1,30 @@
+// run
+
+// Copyright 2026 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"fmt"
+	"io"
+	"reflect"
+	"unsafe"
+)
+
+type T struct{ x int }
+
+func (*T) Read(p []byte) (int, error) { return 0, nil }
+
+func main() {
+	var rw io.ReadWriter // nil, of a different interface type
+	nilRW := reflect.ValueOf(&rw).Elem()
+
+	var r io.Reader = &T{}
+	reflect.ValueOf(&r).Elem().Set(nilRW)
+	got := *(*[2]uintptr)(unsafe.Pointer(&r))
+	if got != ([2]uintptr{0, 0}) {
+		fmt.Println("not zeroed", got)
+	}
+}