We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 808aaea commit 78e280eCopy full SHA for 78e280e
src/reflect/value.go
@@ -257,8 +257,8 @@ func (v Value) Addr() Value {
257
if v.flag&flagAddr == 0 {
258
panic("reflect.Value.Addr of unaddressable value")
259
}
260
- // Inherits possible read only flags from this value,
261
- // so that later Elem() will restore equivalent value back.
+ // Preserve flagRO instead of using v.flag.ro() so that
+ // v.Addr().Elem() is equivalent to v (#32772)
262
fl := v.flag & flagRO
263
return Value{v.typ.ptrTo(), v.ptr, fl | flag(Ptr)}
264
0 commit comments