We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 881a5c7 commit a1be1cbCopy full SHA for a1be1cb
cc/arch/aarch64/codegen.rs
@@ -619,9 +619,12 @@ impl RegAlloc {
619
}
620
PseudoKind::Sym(name) => {
621
// Check if this is a local variable or a global symbol
622
- if func.locals.contains_key(name) {
623
- // Local variable - allocate stack space
624
- self.stack_offset += 8;
+ if let Some(local) = func.locals.get(name) {
+ // Local variable - allocate stack space based on actual type size
+ let size = local.typ.size_bytes().max(8) as i32;
625
+ // Align to 8 bytes
626
+ let aligned_size = (size + 7) & !7;
627
+ self.stack_offset += aligned_size;
628
self.locations
629
.insert(interval.pseudo, Loc::Stack(-self.stack_offset));
630
} else {
0 commit comments