mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
reflect: another obscure RO bug
This commit is contained in:
@@ -276,7 +276,9 @@ func (v Value) Addr() Value {
|
|||||||
if !v.CanAddr() {
|
if !v.CanAddr() {
|
||||||
panic("reflect.Value.Addr of unaddressable value")
|
panic("reflect.Value.Addr of unaddressable value")
|
||||||
}
|
}
|
||||||
flags := (v.flags & (valueFlagExported)) | v.flags.ro()
|
// Preserve flagRO instead of using v.flag.ro() so that
|
||||||
|
// v.Addr().Elem() is equivalent to v (#32772)
|
||||||
|
flags := v.flags & (valueFlagExported | valueFlagRO)
|
||||||
return Value{
|
return Value{
|
||||||
typecode: pointerTo(v.typecode),
|
typecode: pointerTo(v.typecode),
|
||||||
value: v.value,
|
value: v.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user