closure: MakeClosure/makeClosureCtx fix

This commit is contained in:
xushiwei
2024-05-05 23:32:54 +08:00
parent 8ab662b373
commit f17a4ca1de
5 changed files with 111 additions and 41 deletions

View File

@@ -196,7 +196,7 @@ func makeClosureCtx(pkg *types.Package, vars []*ssa.FreeVar) *types.Var {
for i, v := range vars {
flds[i] = types.NewField(token.NoPos, pkg, v.Name(), v.Type(), false)
}
t := types.NewStruct(flds, nil)
t := types.NewPointer(types.NewStruct(flds, nil))
return types.NewParam(token.NoPos, pkg, "__llgo_ctx", t)
}