From ace117064619c11a386af7ee0eb6ec4fe4b52790 Mon Sep 17 00:00:00 2001 From: Hydrostic Date: Thu, 14 May 2026 19:55:28 +0800 Subject: [PATCH] fix(ir): Adopt to toolchain version --- src/ir/generator.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ir/generator.rs b/src/ir/generator.rs index 41404df..b83245f 100644 --- a/src/ir/generator.rs +++ b/src/ir/generator.rs @@ -566,16 +566,18 @@ impl Generator { instrs.push(IRInstr::Move(temp_var, MoveRValue::Var(right_var))); right_var = temp_var; } - if !op.is_logical() && let Some((true_exit, false_exit)) = parent_exit { - let final_exit = self.request_label(); - instrs.push(IRInstr::Label(true_exit)); - instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(1))); - instrs.push(IRInstr::Goto(final_exit)); - instrs.push(IRInstr::Label(false_exit)); - instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(0))); - instrs.push(IRInstr::Label(final_exit)); + if !op.is_logical() { + if let Some((true_exit, false_exit)) = parent_exit { + let final_exit = self.request_label(); + instrs.push(IRInstr::Label(true_exit)); + instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(1))); + instrs.push(IRInstr::Goto(final_exit)); + instrs.push(IRInstr::Label(false_exit)); + instrs.push(IRInstr::Move(dest_var, MoveRValue::ConstInt(0))); + instrs.push(IRInstr::Label(final_exit)); + } } if op.is_logical() { return Some((instrs, Some(dest_var)));