| ... | @@ -786,6 +786,11 @@ fn allocMem(self: *Self, inst: Air.Inst.Index, abi_size: u32, abi_align: u32) !u | ... | @@ -786,6 +786,11 @@ fn allocMem(self: *Self, inst: Air.Inst.Index, abi_size: u32, abi_align: u32) !u |
| 786 | /// Use a pointer instruction as the basis for allocating stack memory. | 786 | /// Use a pointer instruction as the basis for allocating stack memory. |
| 787 | fn allocMemPtr(self: *Self, inst: Air.Inst.Index) !u32 { | 787 | fn allocMemPtr(self: *Self, inst: Air.Inst.Index) !u32 { |
| 788 | const elem_ty = self.air.typeOfIndex(inst).elemType(); | 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 | const abi_size = math.cast(u32, elem_ty.abiSize(self.target.*)) catch { | 794 | const abi_size = math.cast(u32, elem_ty.abiSize(self.target.*)) catch { |
| 790 | return self.fail("type '{}' too big to fit into stack frame", .{elem_ty}); | 795 | return self.fail("type '{}' too big to fit into stack frame", .{elem_ty}); |
| 791 | }; | 796 | }; |