closureStub bugfix; llgen: SetRuntime

This commit is contained in:
xushiwei
2024-05-05 19:44:16 +08:00
parent 4f1b6e95a1
commit 2bbd828f3a
4 changed files with 52 additions and 14 deletions

View File

@@ -71,6 +71,11 @@ func Gen(pkgPath, inFile string, src any) string {
}
prog := llssa.NewProgram(nil)
prog.SetRuntime(func() *types.Package {
rt, err := imp.Import(llssa.PkgRuntime)
check(err)
return rt
})
ret, err := cl.NewPackage(prog, ssaPkg, files)
check(err)