| ... | @@ -1031,13 +1031,12 @@ fn unflattenArray( | ... | @@ -1031,13 +1031,12 @@ fn unflattenArray( |
| 1031 | } | 1031 | } |
| 1032 | | 1032 | |
| 1033 | const elem_ty = ty.childType(zcu); | 1033 | const elem_ty = ty.childType(zcu); |
| 1034 | const buf = try arena.alloc(InternPool.Index, @intCast(ty.arrayLen(zcu))); | 1034 | const buf = try arena.alloc(InternPool.Index, @intCast(ty.arrayLenIncludingSentinel(zcu))); |
| 1035 | for (buf) |*elem| { | 1035 | for (buf) |*elem| { |
| 1036 | elem.* = (try unflattenArray(sema, elem_ty, elems, next_idx)).toIntern(); | 1036 | elem.* = (try unflattenArray(sema, elem_ty, elems, next_idx)).toIntern(); |
| 1037 | } | 1037 | } |
| 1038 | if (ty.sentinel(zcu) != null) { | 1038 | if (ty.sentinel(zcu)) |sent| { |
| 1039 | // TODO: validate sentinel | 1039 | assert(sent.toIntern() == buf[buf.len - 1]); |
| 1040 | _ = try unflattenArray(sema, elem_ty, elems, next_idx); | | |
| 1041 | } | 1040 | } |
| 1042 | return pt.aggregateValue(ty, buf); | 1041 | return pt.aggregateValue(ty, buf); |
| 1043 | } | 1042 | } |