ssa: fix abiTupleOf

This commit is contained in:
visualfc
2025-09-25 19:42:08 +08:00
parent 8959c83397
commit 5592a8fc26
13 changed files with 2850 additions and 2750 deletions

View File

@@ -86,14 +86,18 @@ func (b Builder) abiTypeOf(t types.Type) func() Expr {
func (b Builder) abiTupleOf(t *types.Tuple) func() Expr {
n := t.Len()
tuple := make([]Expr, n)
tuple := make([]func() Expr, n)
for i := 0; i < n; i++ {
tuple[i] = b.abiType(t.At(i).Type())
tuple[i] = b.abiTypeOf(t.At(i).Type())
}
return func() Expr {
prog := b.Prog
tSlice := prog.Slice(prog.AbiTypePtr())
return b.SliceLit(tSlice, tuple...)
elts := make([]Expr, n)
for i := 0; i < n; i++ {
elts[i] = tuple[i]()
}
return b.SliceLit(tSlice, elts...)
}
}