| ... | ... | @@ -1875,7 +1875,7 @@ fn zirCoerceResultPtr(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileE |
| 1875 | 1875 | |
| 1876 | 1876 | const dummy_ptr = try trash_block.addTy(.alloc, sema.typeOf(ptr)); |
| 1877 | 1877 | const dummy_operand = try trash_block.addBitCast(pointee_ty, .void_value); |
| 1878 | | try sema.storePtr(&trash_block, src, dummy_ptr, dummy_operand); |
| 1878 | try sema.storePtr2(&trash_block, src, dummy_ptr, src, dummy_operand, src, .bitcast); |
| 1879 | 1879 | |
| 1880 | 1880 | { |
| 1881 | 1881 | const air_tags = sema.air_instructions.items(.tag); |
| ... | ... | @@ -20187,6 +20187,13 @@ fn storePtr2( |
| 20187 | 20187 | |
| 20188 | 20188 | // TODO handle if the element type requires comptime |
| 20189 | 20189 | |
| 20190 | if (air_tag == .bitcast) { |
| 20191 | // `air_tag == .bitcast` is used as a special case for `zirCoerceResultPtr` |
| 20192 | // to avoid calling `requireRuntimeBlock` for the dummy block. |
| 20193 | _ = try block.addBinOp(.store, ptr, operand); |
| 20194 | return; |
| 20195 | } |
| 20196 | |
| 20190 | 20197 | try sema.requireRuntimeBlock(block, runtime_src); |
| 20191 | 20198 | try sema.queueFullTypeResolution(elem_ty); |
| 20192 | 20199 | _ = try block.addBinOp(air_tag, ptr, operand); |