fix(ir): Adopt to toolchain version

This commit is contained in:
2026-05-14 19:55:28 +08:00
parent 5afeeae562
commit ace1170646
+10 -8
View File
@@ -566,16 +566,18 @@ impl Generator {
instrs.push(IRInstr::Move(temp_var, MoveRValue::Var(right_var))); instrs.push(IRInstr::Move(temp_var, MoveRValue::Var(right_var)));
right_var = temp_var; right_var = temp_var;
} }
if !op.is_logical() && let Some((true_exit, false_exit)) = parent_exit { if !op.is_logical() {
let final_exit = self.request_label(); if let Some((true_exit, false_exit)) = parent_exit {
instrs.push(IRInstr::Label(true_exit)); let final_exit = self.request_label();
instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(1))); instrs.push(IRInstr::Label(true_exit));
instrs.push(IRInstr::Goto(final_exit)); instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(1)));
instrs.push(IRInstr::Label(false_exit)); instrs.push(IRInstr::Goto(final_exit));
instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(0))); instrs.push(IRInstr::Label(false_exit));
instrs.push(IRInstr::Label(final_exit)); instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(0)));
instrs.push(IRInstr::Label(final_exit));
}
} }
if op.is_logical() { if op.is_logical() {
return Some((instrs, Some(dest_var))); return Some((instrs, Some(dest_var)));