| ... | @@ -9035,10 +9035,13 @@ fn elemPtrArray( | ... | @@ -9035,10 +9035,13 @@ fn elemPtrArray( |
| 9035 | ) CompileError!Air.Inst.Ref { | 9035 | ) CompileError!Air.Inst.Ref { |
| 9036 | const array_ptr_ty = sema.typeOf(array_ptr); | 9036 | const array_ptr_ty = sema.typeOf(array_ptr); |
| 9037 | const pointee_type = array_ptr_ty.elemType().elemType(); | 9037 | const pointee_type = array_ptr_ty.elemType().elemType(); |
| 9038 | const result_ty = if (array_ptr_ty.ptrIsMutable()) | 9038 | const result_ty = try Module.simplePtrTypeWithAddressSpace( |
| 9039 | try Type.Tag.single_mut_pointer.create(sema.arena, pointee_type) | 9039 | sema.arena, |
| 9040 | else | 9040 | pointee_type, |
| 9041 | try Type.Tag.single_const_pointer.create(sema.arena, pointee_type); | 9041 | array_ptr_ty.ptrIsMutable(), |
| | 9042 | .One, |
| | 9043 | array_ptr_ty.ptrAddressSpace(), |
| | 9044 | ); |
| 9042 | | 9045 | |
| 9043 | if (try sema.resolveDefinedValue(block, src, array_ptr)) |array_ptr_val| { | 9046 | if (try sema.resolveDefinedValue(block, src, array_ptr)) |array_ptr_val| { |
| 9044 | if (try sema.resolveDefinedValue(block, elem_index_src, elem_index)) |index_val| { | 9047 | if (try sema.resolveDefinedValue(block, elem_index_src, elem_index)) |index_val| { |