| ... | @@ -784,11 +784,12 @@ pub const DeclGen = struct { | ... | @@ -784,11 +784,12 @@ pub const DeclGen = struct { |
| 784 | .opt_payload => unreachable, // TODO | 784 | .opt_payload => unreachable, // TODO |
| 785 | .comptime_field => unreachable, | 785 | .comptime_field => unreachable, |
| 786 | .elem => |elem_ptr| { | 786 | .elem => |elem_ptr| { |
| 787 | const elem_ptr_ty = mod.intern_pool.typeOf(elem_ptr.base).toType(); | 787 | const parent_ptr_ty = mod.intern_pool.typeOf(elem_ptr.base).toType(); |
| 788 | const parent_ptr_id = try self.constantPtr(elem_ptr_ty, elem_ptr.base.toValue()); | 788 | const parent_ptr_id = try self.constantPtr(parent_ptr_ty, elem_ptr.base.toValue()); |
| 789 | const size_ty_ref = try self.sizeType(); | 789 | const size_ty_ref = try self.sizeType(); |
| 790 | const index_id = try self.constInt(size_ty_ref, elem_ptr.index); | 790 | const index_id = try self.constInt(size_ty_ref, elem_ptr.index); |
| 791 | return self.ptrAccessChain(result_ty_ref, parent_ptr_id, index_id, &.{}); | 791 | |
| | 792 | return try self.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id); |
| 792 | }, | 793 | }, |
| 793 | .field => unreachable, // TODO | 794 | .field => unreachable, // TODO |
| 794 | } | 795 | } |