| author | |
| committer | |
| log | 4b14384989362f93cd014628810c63b5cd9d3fff |
| tree | cb5e572df14eb14a29bd035450d9e54cb2a52afc |
| parent | 1b8ed7842cc09ff687aa7386bf3af8565055a8d1 |
2 files changed, 6 insertions(+), 1 deletions(-)
src/arch/aarch64/CodeGen.zig+5| ... | ... | @@ -786,6 +786,11 @@ fn allocMem(self: *Self, inst: Air.Inst.Index, abi_size: u32, abi_align: u32) !u |
| 786 | 786 | /// Use a pointer instruction as the basis for allocating stack memory. |
| 787 | 787 | fn allocMemPtr(self: *Self, inst: Air.Inst.Index) !u32 { |
| 788 | 788 | const elem_ty = self.air.typeOfIndex(inst).elemType(); |
| 789 | ||
| 790 | if (!elem_ty.hasRuntimeBits()) { | |
| 791 | return self.allocMem(inst, @sizeOf(usize), @alignOf(usize)); | |
| 792 | } | |
| 793 | ||
| 789 | 794 | const abi_size = math.cast(u32, elem_ty.abiSize(self.target.*)) catch { |
| 790 | 795 | return self.fail("type '{}' too big to fit into stack frame", .{elem_ty}); |
| 791 | 796 | }; |
src/arch/x86_64/CodeGen.zig+1-1| ... | ... | @@ -852,7 +852,7 @@ fn allocMemPtr(self: *Self, inst: Air.Inst.Index) !u32 { |
| 852 | 852 | const elem_ty = ptr_ty.elemType(); |
| 853 | 853 | |
| 854 | 854 | if (!elem_ty.hasRuntimeBits()) { |
| 855 | return self.allocMem(inst, 8, 8); | |
| 855 | return self.allocMem(inst, @sizeOf(usize), @alignOf(usize)); | |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | const abi_size = math.cast(u32, elem_ty.abiSize(self.target.*)) catch { |