Fix comparisons not working for integers

This commit is contained in:
Sofia 2025-07-21 20:25:28 +03:00
parent 7929a798af
commit fe145ad2ef

View File

@ -641,7 +641,7 @@ impl mir::Expression {
(mir::BinaryOperator::Mult, _, false) => Instr::Mul(lhs, rhs), (mir::BinaryOperator::Mult, _, false) => Instr::Mul(lhs, rhs),
(mir::BinaryOperator::Mult, _, true) => Instr::FMul(lhs, rhs), (mir::BinaryOperator::Mult, _, true) => Instr::FMul(lhs, rhs),
(mir::BinaryOperator::And, _, _) => Instr::And(lhs, rhs), (mir::BinaryOperator::And, _, _) => Instr::And(lhs, rhs),
(mir::BinaryOperator::Cmp(i), _, true) => { (mir::BinaryOperator::Cmp(i), _, false) => {
Instr::ICmp(i.int_predicate(), lhs, rhs) Instr::ICmp(i.int_predicate(), lhs, rhs)
} }
_ => todo!(), _ => todo!(),