| ... | @@ -9106,8 +9106,8 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai | ... | @@ -9106,8 +9106,8 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 9106 | const rhs_len = try sema.usizeCast(block, lhs_src, rhs_info.len); | 9106 | const rhs_len = try sema.usizeCast(block, lhs_src, rhs_info.len); |
| 9107 | const final_len = lhs_len + rhs_len; | 9107 | const final_len = lhs_len + rhs_len; |
| 9108 | const final_len_including_sent = final_len + @boolToInt(res_sent != null); | 9108 | const final_len_including_sent = final_len + @boolToInt(res_sent != null); |
| 9109 | const lhs_single_ptr = lhs_ty.zigTypeTag() == .Pointer and !lhs_ty.isSlice(); | 9109 | const lhs_single_ptr = lhs_ty.isSinglePointer(); |
| 9110 | const rhs_single_ptr = rhs_ty.zigTypeTag() == .Pointer and !rhs_ty.isSlice(); | 9110 | const rhs_single_ptr = rhs_ty.isSinglePointer(); |
| 9111 | const lhs_sub_val = if (lhs_single_ptr) (try sema.pointerDeref(block, lhs_src, lhs_val, lhs_ty)).? else lhs_val; | 9111 | const lhs_sub_val = if (lhs_single_ptr) (try sema.pointerDeref(block, lhs_src, lhs_val, lhs_ty)).? else lhs_val; |
| 9112 | const rhs_sub_val = if (rhs_single_ptr) (try sema.pointerDeref(block, rhs_src, rhs_val, rhs_ty)).? else rhs_val; | 9112 | const rhs_sub_val = if (rhs_single_ptr) (try sema.pointerDeref(block, rhs_src, rhs_val, rhs_ty)).? else rhs_val; |
| 9113 | var anon_decl = try block.startAnonDecl(LazySrcLoc.unneeded); | 9113 | var anon_decl = try block.startAnonDecl(LazySrcLoc.unneeded); |
| ... | @@ -9160,17 +9160,21 @@ fn getArrayCatInfo(sema: *Sema, block: *Block, src: LazySrcLoc, inst: Air.Inst.R | ... | @@ -9160,17 +9160,21 @@ fn getArrayCatInfo(sema: *Sema, block: *Block, src: LazySrcLoc, inst: Air.Inst.R |
| 9160 | .Array => t.arrayInfo(), | 9160 | .Array => t.arrayInfo(), |
| 9161 | .Pointer => blk: { | 9161 | .Pointer => blk: { |
| 9162 | const ptrinfo = t.ptrInfo().data; | 9162 | const ptrinfo = t.ptrInfo().data; |
| 9163 | if (ptrinfo.size == .Slice) { | 9163 | switch (ptrinfo.size) { |
| 9164 | const val = try sema.resolveConstValue(block, src, inst); | 9164 | .Slice, .Many => { |
| 9165 | return Type.ArrayInfo{ | 9165 | const val = try sema.resolveConstValue(block, src, inst); |
| 9166 | .elem_type = t.childType(), | 9166 | return Type.ArrayInfo{ |
| 9167 | .sentinel = t.sentinel(), | 9167 | .elem_type = t.childType(), |
| 9168 | .len = val.sliceLen(sema.mod), | 9168 | .sentinel = t.sentinel(), |
| 9169 | }; | 9169 | .len = val.sliceLen(sema.mod), |
| | 9170 | }; |
| | 9171 | }, |
| | 9172 | .One => { |
| | 9173 | if (ptrinfo.pointee_type.zigTypeTag() != .Array) return null; |
| | 9174 | break :blk ptrinfo.pointee_type.arrayInfo(); |
| | 9175 | }, |
| | 9176 | .C => return null, |
| 9170 | } | 9177 | } |
| 9171 | if (ptrinfo.pointee_type.zigTypeTag() != .Array) return null; | | |
| 9172 | if (ptrinfo.size != .One) return null; | | |
| 9173 | break :blk ptrinfo.pointee_type.arrayInfo(); | | |
| 9174 | }, | 9178 | }, |
| 9175 | else => null, | 9179 | else => null, |
| 9176 | }; | 9180 | }; |