diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
commit | 8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5 (patch) | |
tree | ba71646a10b518372d110532d86fcf0b98edc14f /src/pkg/reflect/makefunc.go | |
parent | 3bb719bbf3cdb97b3901f3baaa2da9d02a5c3cdb (diff) | |
parent | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (diff) | |
download | golang-8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5.tar.gz |
Merge tag 'upstream/1.3' into debian-sid
Upstream version 1.3
Diffstat (limited to 'src/pkg/reflect/makefunc.go')
-rw-r--r-- | src/pkg/reflect/makefunc.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/reflect/makefunc.go b/src/pkg/reflect/makefunc.go index e1608ea6c..0e61fdea7 100644 --- a/src/pkg/reflect/makefunc.go +++ b/src/pkg/reflect/makefunc.go @@ -56,7 +56,7 @@ func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value { impl := &makeFuncImpl{code: code, typ: ftyp, fn: fn} - return Value{t, unsafe.Pointer(impl), flag(Func) << flagKindShift} + return Value{t, unsafe.Pointer(impl), 0, flag(Func) << flagKindShift} } // makeFuncStub is an assembly function that is the code half of @@ -81,13 +81,13 @@ type methodValue struct { // by code like Convert and Interface and Assign. func makeMethodValue(op string, v Value) Value { if v.flag&flagMethod == 0 { - panic("reflect: internal error: invalid use of makePartialFunc") + panic("reflect: internal error: invalid use of makeMethodValue") } // Ignoring the flagMethod bit, v describes the receiver, not the method type. fl := v.flag & (flagRO | flagAddr | flagIndir) fl |= flag(v.typ.Kind()) << flagKindShift - rcvr := Value{v.typ, v.val, fl} + rcvr := Value{v.typ, v.ptr, v.scalar, fl} // v.Type returns the actual type of the method value. funcType := v.Type().(*rtype) @@ -109,7 +109,7 @@ func makeMethodValue(op string, v Value) Value { // but we want Interface() and other operations to fail early. methodReceiver(op, fv.rcvr, fv.method) - return Value{funcType, unsafe.Pointer(fv), v.flag&flagRO | flag(Func)<<flagKindShift} + return Value{funcType, unsafe.Pointer(fv), 0, v.flag&flagRO | flag(Func)<<flagKindShift} } // methodValueCall is an assembly function that is the code half of |