| ... | @@ -24311,7 +24311,8 @@ fn analyzeMinMax( | ... | @@ -24311,7 +24311,8 @@ fn analyzeMinMax( |
| 24311 | | 24311 | |
| 24312 | fn upgradeToArrayPtr(sema: *Sema, block: *Block, ptr: Air.Inst.Ref, len: u64) !Air.Inst.Ref { | 24312 | fn upgradeToArrayPtr(sema: *Sema, block: *Block, ptr: Air.Inst.Ref, len: u64) !Air.Inst.Ref { |
| 24313 | const mod = sema.mod; | 24313 | const mod = sema.mod; |
| 24314 | const info = sema.typeOf(ptr).ptrInfo(mod); | 24314 | const ptr_ty = sema.typeOf(ptr); |
| | 24315 | const info = ptr_ty.ptrInfo(mod); |
| 24315 | if (info.flags.size == .One) { | 24316 | if (info.flags.size == .One) { |
| 24316 | // Already an array pointer. | 24317 | // Already an array pointer. |
| 24317 | return ptr; | 24318 | return ptr; |
| ... | @@ -24330,10 +24331,11 @@ fn upgradeToArrayPtr(sema: *Sema, block: *Block, ptr: Air.Inst.Ref, len: u64) !A | ... | @@ -24330,10 +24331,11 @@ fn upgradeToArrayPtr(sema: *Sema, block: *Block, ptr: Air.Inst.Ref, len: u64) !A |
| 24330 | .address_space = info.flags.address_space, | 24331 | .address_space = info.flags.address_space, |
| 24331 | }, | 24332 | }, |
| 24332 | }); | 24333 | }); |
| 24333 | if (info.flags.size == .Slice) { | 24334 | const non_slice_ptr = if (info.flags.size == .Slice) |
| 24334 | return block.addTyOp(.slice_ptr, new_ty, ptr); | 24335 | try block.addTyOp(.slice_ptr, ptr_ty.slicePtrFieldType(mod), ptr) |
| 24335 | } | 24336 | else |
| 24336 | return block.addBitCast(new_ty, ptr); | 24337 | ptr; |
| | 24338 | return block.addBitCast(new_ty, non_slice_ptr); |
| 24337 | } | 24339 | } |
| 24338 | | 24340 | |
| 24339 | fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void { | 24341 | fn zirMemcpy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void { |