Skip to content

Commit 1929dea

Browse files
committed
bugfix match arm scopes
1 parent b795923 commit 1929dea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/lean_compiler/src/b_compile_intermediate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,10 @@ fn compile_lines(
219219
let mut new_stack_pos = saved_stack_pos;
220220
for arm in arms.iter() {
221221
compiler.stack_pos = saved_stack_pos;
222+
compiler.stack_frame_layout.scopes.push(ScopeLayout::default());
222223
let arm_instructions = compile_lines(function_name, arm, compiler, Some(end_label.clone()))?;
223224
compiled_arms.push(arm_instructions);
225+
compiler.stack_frame_layout.scopes.pop();
224226
new_stack_pos = new_stack_pos.max(compiler.stack_pos);
225227
}
226228
compiler.stack_pos = new_stack_pos;

0 commit comments

Comments
 (0)