mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Ensure stack frame is always popped when procedure returns from inside a branch
This commit is contained in:
parent
79ac2f04b8
commit
7ac7e16f60
4 changed files with 49 additions and 24 deletions
|
@ -26,7 +26,7 @@ pub const ALIGN_8: u32 = 3;
|
|||
pub const STACK_POINTER_GLOBAL_ID: u32 = 0;
|
||||
pub const STACK_ALIGNMENT_BYTES: i32 = 16;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct LocalId(pub u32);
|
||||
|
||||
pub struct Env<'a> {
|
||||
|
@ -163,7 +163,7 @@ pub fn round_up_to_alignment(unaligned: i32, alignment_bytes: i32) -> i32 {
|
|||
aligned
|
||||
}
|
||||
|
||||
pub fn allocate_stack_frame(
|
||||
pub fn push_stack_frame(
|
||||
instructions: &mut Vec<Instruction>,
|
||||
size: i32,
|
||||
local_frame_pointer: LocalId,
|
||||
|
@ -178,7 +178,7 @@ pub fn allocate_stack_frame(
|
|||
]);
|
||||
}
|
||||
|
||||
pub fn free_stack_frame(
|
||||
pub fn pop_stack_frame(
|
||||
instructions: &mut Vec<Instruction>,
|
||||
size: i32,
|
||||
local_frame_pointer: LocalId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue