From 24c7928c4b0823c1c212ab268bc133eb600390db Mon Sep 17 00:00:00 2001 From: xushiwei Date: Tue, 18 Jun 2024 18:32:29 +0800 Subject: [PATCH] cl: pkgFNoOldInit flag if no initFnNameOld --- cl/compile.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cl/compile.go b/cl/compile.go index 2a501794..4b72f945 100644 --- a/cl/compile.go +++ b/cl/compile.go @@ -111,6 +111,8 @@ const ( pkgNormal pkgState = iota pkgHasPatch pkgInPatch + + pkgFNoOldInit = 0x80 // flag if no initFnNameOld ) func (p *context) inMain(instr ssa.Instruction) bool { @@ -773,6 +775,9 @@ func NewPackageEx(prog llssa.Program, patches Patches, pkg *ssa.Package, files [ skips := ctx.skips ctx.skips = nil ctx.state = pkgInPatch + if _, ok := skips["init"]; ok || ctx.skipall { + ctx.state |= pkgFNoOldInit + } processPkg(ctx, ret, alt) ctx.state = pkgHasPatch ctx.skips = skips