Initialize stack pointer when it doesn't exist

I'm not sure this is right, but we have to do it somewhere.. and here
seems reasonable?
This commit is contained in:
ayazhafiz 2021-12-26 17:46:06 -06:00
parent 326bfe9aa3
commit 4631ff96f5

View file

@ -519,6 +519,10 @@ impl<'a> Storage<'a> {
alignment_bytes, alignment_bytes,
.. ..
} => { } => {
if self.stack_frame_pointer.is_none() {
self.stack_frame_pointer = Some(self.get_next_local_id());
}
let (to_ptr, to_offset) = location.local_and_offset(self.stack_frame_pointer); let (to_ptr, to_offset) = location.local_and_offset(self.stack_frame_pointer);
copy_memory( copy_memory(
code_builder, code_builder,