ssa: fix abi patch types.pointer

This commit is contained in:
visualfc
2024-07-02 08:40:44 +08:00
parent 9e55cb114c
commit 8772c85964

View File

@@ -313,10 +313,18 @@ func lastParamType(prog Program, fn Expr) Type {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
func (p Package) patchType(t types.Type) types.Type {
switch t := t.(type) {
case *types.Pointer:
return types.NewPointer(p.patchType(t.Elem()))
}
return p.patch(t)
}
func (p Package) abiTypeInit(g Global, t types.Type, pub bool) { func (p Package) abiTypeInit(g Global, t types.Type, pub bool) {
b := p.afterBuilder() b := p.afterBuilder()
if p.patch != nil { if p.patch != nil {
t = p.patch(t) t = p.patchType(t)
} }
tabi := b.abiTypeOf(t) tabi := b.abiTypeOf(t)
expr := g.Expr expr := g.Expr