ssa: fix func binop eq

This commit is contained in:
visualfc
2024-07-07 20:30:02 +08:00
parent ffa74db136
commit 3875bc34bd
3 changed files with 161 additions and 6 deletions

View File

@@ -550,7 +550,14 @@ func (b Builder) BinOp(op token.Token, x, y Expr) Expr {
x = b.Field(x, 0)
y = b.Field(y, 0)
fallthrough
case vkFuncPtr, vkFuncDecl, vkChan:
case vkFuncPtr, vkFuncDecl:
switch op {
case token.EQL:
return b.Prog.BoolVal(x.impl.IsNull() == y.impl.IsNull())
case token.NEQ:
return b.Prog.BoolVal(x.impl.IsNull() != y.impl.IsNull())
}
case vkChan:
switch op {
case token.EQL:
return Expr{llvm.CreateICmp(b.impl, llvm.IntEQ, x.impl, y.impl), tret}