patch sync/atomic; typepatch fix (don't change types)

This commit is contained in:
xushiwei
2024-06-17 03:38:01 +08:00
parent 68a63bb280
commit b4794dc541
9 changed files with 328 additions and 132 deletions

View File

@@ -127,14 +127,22 @@ func pkgKindByScope(scope *types.Scope) (int, string) {
}
func (p *context) importPkg(pkg *types.Package, i *pkgInfo) {
pkgPath := llssa.PathOf(pkg)
scope := pkg.Scope()
kind, _ := pkgKindByScope(scope)
if kind == PkgNormal {
if alt, ok := p.patches[pkgPath]; ok {
pkg = alt.Pkg
scope = pkg.Scope()
if kind, _ = pkgKindByScope(scope); kind != PkgNormal {
goto start
}
}
return
}
start:
i.kind = kind
fset := p.fset
pkgPath := llssa.PathOf(pkg)
names := scope.Names()
syms := newPkgSymInfo()
for _, name := range names {