Skip to content

Commit 942dadc

Browse files
committed
Fix conditional; Passing all test from the book
1 parent 0c919ab commit 942dadc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rust_src/ast_to_tacky.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl AstToTacky {
131131
let mut true_instrs: InstructionVec = Vec::new();
132132
let true_val = self.convert_expr(true_expr, &mut true_instrs);
133133
let mut false_instrs: InstructionVec = Vec::new();
134-
let false_val = self.convert_expr(false_expr, &mut true_instrs);
134+
let false_val = self.convert_expr(false_expr, &mut false_instrs);
135135
// Start instruction construction with condition value and instructions
136136
let cond_val = self.convert_expr(cond, instructions);
137137
instructions.push(tacky::Instruction::JumpIfZero {

0 commit comments

Comments
 (0)