From 04416a67d3d71f5c69b392be30aa028e8576293d Mon Sep 17 00:00:00 2001 From: xushiwei Date: Mon, 1 Jul 2024 19:05:12 +0800 Subject: [PATCH] cl: SetPatch fix --- _demo/fmtdemo/fmt.go | 7 +++++++ cl/compile.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 _demo/fmtdemo/fmt.go diff --git a/_demo/fmtdemo/fmt.go b/_demo/fmtdemo/fmt.go new file mode 100644 index 00000000..8117330d --- /dev/null +++ b/_demo/fmtdemo/fmt.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world") +} diff --git a/cl/compile.go b/cl/compile.go index b5a299c6..188b274f 100644 --- a/cl/compile.go +++ b/cl/compile.go @@ -786,11 +786,11 @@ func NewPackageEx(prog llssa.Program, patches Patches, pkg *ssa.Package, files [ } ctx.initPyModule() ctx.initFiles(pkgPath, files) + ret.SetPatch(ctx.patchType) if hasPatch { skips := ctx.skips typepatch.Merge(pkgTypes, oldTypes, skips, ctx.skipall) - ret.SetPatch(ctx.patchType) ctx.skips = nil ctx.state = pkgInPatch if _, ok := skips["init"]; ok || ctx.skipall {