cl: compile ssa.Function bugfix

This commit is contained in:
xushiwei
2024-05-04 17:46:33 +08:00
parent c0ef1598c9
commit 9b9da3133d
2 changed files with 10 additions and 10 deletions

View File

@@ -602,15 +602,15 @@ func (p *context) compileValue(b llssa.Builder, v ssa.Value) llssa.Expr {
}
}
case *ssa.Function:
fn := p.compileFunc(p.pkg, p.goTyps, v, true)
return fn.Expr
/*
fn, ftype := p.funcOf(v)
if ftype >= llgoInstrBase {
panic("can't use llgo instruction as a value")
}
if v.Blocks != nil {
fn := p.compileFunc(p.pkg, p.goTyps, v, true)
return fn.Expr
*/
}
fn, ftype := p.funcOf(v)
if ftype >= llgoInstrBase {
panic("can't use llgo instruction as a value")
}
return fn.Expr
case *ssa.Global:
g := p.varOf(v)
return g.Expr