diff options
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/reflect.go')
-rw-r--r-- | src/cmd/compile/internal/reflectdata/reflect.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 7eba5fb41e..3bf248a7ad 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -2006,13 +2006,23 @@ func MarkUsedIfaceMethod(n *ir.CallExpr) { tsym := TypeLinksym(ityp) r := obj.Addrel(ir.CurFunc.LSym) r.Sym = tsym - // dot.Xoffset is the method index * PtrSize (the offset of code pointer + // dot.Offset() is the method index * PtrSize (the offset of code pointer // in itab). midx := dot.Offset() / int64(types.PtrSize) r.Add = InterfaceMethodOffset(ityp, midx) r.Type = objabi.R_USEIFACEMETHOD } +// MarkUsedIfaceMethodIndex marks that that method number ix (in the AllMethods list) +// of interface type ityp is used, and should be attached to lsym. +func MarkUsedIfaceMethodIndex(lsym *obj.LSym, ityp *types.Type, ix int) { + tsym := TypeLinksym(ityp) + r := obj.Addrel(lsym) + r.Sym = tsym + r.Add = InterfaceMethodOffset(ityp, int64(ix)) + r.Type = objabi.R_USEIFACEMETHOD +} + // getDictionary returns the dictionary for the given named generic function // or method, with the given type arguments. func getDictionary(gf *types.Sym, targs []*types.Type) ir.Node { |