ssa: abiNamed set underlying size
This commit is contained in:
@@ -206,13 +206,19 @@ func (b Builder) abiNamed(t *types.Named) Expr {
|
||||
pkg := b.Pkg
|
||||
tunder := t.Underlying()
|
||||
kind := int(abi.UnderlyingKind(tunder))
|
||||
size := b.sizeof(tunder)
|
||||
numMethods, numPtrMethods := b.abiMethods(t)
|
||||
newNamed := pkg.rtFunc("NewNamed")
|
||||
expr := b.Call(newNamed, b.Prog.Val(kind), b.Prog.Val(numMethods), b.Prog.Val(numPtrMethods))
|
||||
expr := b.Call(newNamed, b.Prog.Val(kind), b.Prog.IntVal(uint64(size), b.Prog.Uintptr()), b.Prog.Val(numMethods), b.Prog.Val(numPtrMethods))
|
||||
b.Pkg.named[t] = expr
|
||||
return expr
|
||||
}
|
||||
|
||||
func (b Builder) sizeof(t types.Type) int64 {
|
||||
sizes := (*goProgram)(b.Prog)
|
||||
return sizes.Sizeof(t)
|
||||
}
|
||||
|
||||
// func InitNamed(ret *Type, pkgPath, name string, underlying *Type, methods, ptrMethods []Method)
|
||||
func (b Builder) abiInitNamed(ret Expr, t *types.Named) func() Expr {
|
||||
under := b.abiType(t.Underlying())
|
||||
|
||||
Reference in New Issue
Block a user