Message ID | mcra9jb14ji.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
Index: libgo/go/reflect/value.go =================================================================== --- libgo/go/reflect/value.go (revision 202233) +++ libgo/go/reflect/value.go (working copy) @@ -611,7 +611,13 @@ func methodReceiver(op string, v Value, } fn = unsafe.Pointer(&m.tfn) t = m.mtyp - rcvr = v.iword() + // Can't call iword here, because it checks v.kind, + // and that is always Func. + if v.flag&flagIndir != 0 && (v.typ.Kind() == Ptr || v.typ.Kind() == UnsafePointer) { + rcvr = loadIword(v.val, v.typ.size) + } else { + rcvr = iword(v.val) + } } return }