compileValue ssa.Function fix: v.Pkg == nil: means auto generated function?

This commit is contained in:
xushiwei
2024-05-05 22:15:39 +08:00
parent 244da4b10a
commit 8ab662b373
2 changed files with 15 additions and 1 deletions

View File

@@ -645,7 +645,8 @@ func (p *context) compileValue(b llssa.Builder, v ssa.Value) llssa.Expr {
}
}
case *ssa.Function:
if v.Pkg == p.goPkg { // function in this package
// v.Pkg == nil: means auto generated function?
if v.Pkg == p.goPkg || v.Pkg == nil { // function in this package
fn := p.compileFunc(p.pkg, p.goTyps, v)
return fn.Expr
}