~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/reflect/makefunc.go

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
        impl := &makeFuncImpl{code: code, typ: ftyp, fn: fn}
58
58
 
59
 
        return Value{t, unsafe.Pointer(impl), flag(Func) << flagKindShift}
 
59
        return Value{t, unsafe.Pointer(impl), 0, flag(Func) << flagKindShift}
60
60
}
61
61
 
62
62
// makeFuncStub is an assembly function that is the code half of
81
81
// by code like Convert and Interface and Assign.
82
82
func makeMethodValue(op string, v Value) Value {
83
83
        if v.flag&flagMethod == 0 {
84
 
                panic("reflect: internal error: invalid use of makePartialFunc")
 
84
                panic("reflect: internal error: invalid use of makeMethodValue")
85
85
        }
86
86
 
87
87
        // Ignoring the flagMethod bit, v describes the receiver, not the method type.
88
88
        fl := v.flag & (flagRO | flagAddr | flagIndir)
89
89
        fl |= flag(v.typ.Kind()) << flagKindShift
90
 
        rcvr := Value{v.typ, v.val, fl}
 
90
        rcvr := Value{v.typ, v.ptr, v.scalar, fl}
91
91
 
92
92
        // v.Type returns the actual type of the method value.
93
93
        funcType := v.Type().(*rtype)
109
109
        // but we want Interface() and other operations to fail early.
110
110
        methodReceiver(op, fv.rcvr, fv.method)
111
111
 
112
 
        return Value{funcType, unsafe.Pointer(fv), v.flag&flagRO | flag(Func)<<flagKindShift}
 
112
        return Value{funcType, unsafe.Pointer(fv), 0, v.flag&flagRO | flag(Func)<<flagKindShift}
113
113
}
114
114
 
115
115
// methodValueCall is an assembly function that is the code half of