| ... | @@ -16825,7 +16825,7 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air | ... | @@ -16825,7 +16825,7 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air |
| 16825 | const bitoffset_src: LazySrcLoc = .{ .node_offset_ptr_bitoffset = extra.data.src_node }; | 16825 | const bitoffset_src: LazySrcLoc = .{ .node_offset_ptr_bitoffset = extra.data.src_node }; |
| 16826 | const hostsize_src: LazySrcLoc = .{ .node_offset_ptr_hostsize = extra.data.src_node }; | 16826 | const hostsize_src: LazySrcLoc = .{ .node_offset_ptr_hostsize = extra.data.src_node }; |
| 16827 | | 16827 | |
| 16828 | const unresolved_elem_ty = blk: { | 16828 | const elem_ty = blk: { |
| 16829 | const air_inst = try sema.resolveInst(extra.data.elem_type); | 16829 | const air_inst = try sema.resolveInst(extra.data.elem_type); |
| 16830 | const ty = sema.analyzeAsType(block, elem_ty_src, air_inst) catch |err| { | 16830 | const ty = sema.analyzeAsType(block, elem_ty_src, air_inst) catch |err| { |
| 16831 | if (err == error.AnalysisFail and sema.err != null and sema.typeOf(air_inst).isSinglePointer()) { | 16831 | if (err == error.AnalysisFail and sema.err != null and sema.typeOf(air_inst).isSinglePointer()) { |
| ... | @@ -16854,7 +16854,7 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air | ... | @@ -16854,7 +16854,7 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air |
| 16854 | // Check if this happens to be the lazy alignment of our element type, in | 16854 | // Check if this happens to be the lazy alignment of our element type, in |
| 16855 | // which case we can make this 0 without resolving it. | 16855 | // which case we can make this 0 without resolving it. |
| 16856 | if (val.castTag(.lazy_align)) |payload| { | 16856 | if (val.castTag(.lazy_align)) |payload| { |
| 16857 | if (payload.data.eql(unresolved_elem_ty, sema.mod)) { | 16857 | if (payload.data.eql(elem_ty, sema.mod)) { |
| 16858 | break :blk 0; | 16858 | break :blk 0; |
| 16859 | } | 16859 | } |
| 16860 | } | 16860 | } |
| ... | @@ -16887,14 +16887,6 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air | ... | @@ -16887,14 +16887,6 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air |
| 16887 | return sema.fail(block, bitoffset_src, "bit offset starts after end of host integer", .{}); | 16887 | return sema.fail(block, bitoffset_src, "bit offset starts after end of host integer", .{}); |
| 16888 | } | 16888 | } |
| 16889 | | 16889 | |
| 16890 | const elem_ty = if (abi_align == 0) | | |
| 16891 | unresolved_elem_ty | | |
| 16892 | else t: { | | |
| 16893 | const elem_ty = try sema.resolveTypeFields(unresolved_elem_ty); | | |
| 16894 | try sema.resolveTypeLayout(elem_ty); | | |
| 16895 | break :t elem_ty; | | |
| 16896 | }; | | |
| 16897 | | | |
| 16898 | if (elem_ty.zigTypeTag() == .NoReturn) { | 16890 | if (elem_ty.zigTypeTag() == .NoReturn) { |
| 16899 | return sema.fail(block, elem_ty_src, "pointer to noreturn not allowed", .{}); | 16891 | return sema.fail(block, elem_ty_src, "pointer to noreturn not allowed", .{}); |
| 16900 | } else if (elem_ty.zigTypeTag() == .Fn) { | 16892 | } else if (elem_ty.zigTypeTag() == .Fn) { |