goTypes.cvtFunc fix: remove sig.Variadic flag

This commit is contained in:
xushiwei
2024-05-15 13:24:44 +08:00
parent 11e74975b3
commit 6a3581f7a3
2 changed files with 2 additions and 2 deletions

View File

@@ -239,7 +239,7 @@ func (p *context) compileFuncDecl(pkg llssa.Package, f *ssa.Function, call bool)
sig = llssa.FuncAddCtx(ctx, sig)
} else {
if debugInstr {
log.Println("==> NewFunc", name, "type:", sig.Recv(), sig)
log.Println("==> NewFunc", name, "type:", sig.Recv(), sig, "ftype:", ftype)
}
}
if fn == nil {

View File

@@ -172,7 +172,7 @@ func (p goTypes) cvtFunc(sig *types.Signature, recv *types.Var) (raw *types.Sign
}
params, cvt1 := p.cvtTuple(sig.Params())
results, cvt2 := p.cvtTuple(sig.Results())
if cvt1 || cvt2 {
if cvt1 || cvt2 || sig.Variadic() {
// variadic always is false in raw type for Go function
return types.NewSignatureType(nil, nil, nil, params, results, false)
}