From 057af792dfa6f8e9cf14b4755b51b98bf59f6788 Mon Sep 17 00:00:00 2001 From: tsingbx Date: Fri, 17 May 2024 09:06:53 +0800 Subject: [PATCH] main return type chang to C int --- cl/compile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl/compile.go b/cl/compile.go index a1419c6a..5a449481 100644 --- a/cl/compile.go +++ b/cl/compile.go @@ -241,7 +241,7 @@ func (p *context) compileFuncDecl(pkg llssa.Package, f *ssa.Function) (llssa.Fun ctx := makeClosureCtx(pkgTypes, f.FreeVars) sig = llssa.FuncAddCtx(ctx, sig) } else { - if debugInstr { + if debugInstr && sig != nil && sig.Recv() != nil { log.Println("==> NewFunc", name, "type:", sig.Recv(), sig, "ftype:", ftype) } } @@ -788,7 +788,7 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) { } if p.inMain(instr) { results = make([]llssa.Expr, 1) - results[0] = p.prog.IntVal(0, p.prog.Int()) + results[0] = p.prog.IntVal(0, p.prog.CInt()) } b.Return(results...) case *ssa.If: