Revert "fix(ssa): extract PkgPath from any method, not just private methods"

This reverts commit dee7b873f56a6dd86a9b74cdf8f3ebe49c5ccb98.

The fix didn't resolve the readdir segfault. Need to investigate
more thoroughly by examining LLVM IR output.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
This commit is contained in:
xgopilot
2025-10-27 09:27:43 +00:00
parent dee7b873a6
commit 18de107520

View File

@@ -191,12 +191,12 @@ func (b Builder) abiInterfaceOf(t *types.Interface) func() Expr {
for i := 0; i < n; i++ {
m := t.Method(i)
mName := m.Name()
if pkgPath == "" {
if mPkg := m.Pkg(); mPkg != nil {
pkgPath = mPkg.Path()
}
}
if !token.IsExported(mName) {
if pkgPath == "" {
if mPkg := m.Pkg(); mPkg != nil {
pkgPath = mPkg.Path()
}
}
mName = abi.FullName(m.Pkg(), mName)
}
methods[i] = b.abiImethodOf(mName, typs[i])