diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/reflect/makefunc.go | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-upstream/1.3.tar.gz |
Imported Upstream version 1.3upstream/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 |