| ... | @@ -24822,8 +24822,13 @@ fn coerceExtra( | ... | @@ -24822,8 +24822,13 @@ fn coerceExtra( |
| 24822 | // empty tuple to zero-length slice | 24822 | // empty tuple to zero-length slice |
| 24823 | // note that this allows coercing to a mutable slice. | 24823 | // note that this allows coercing to a mutable slice. |
| 24824 | if (inst_child_ty.structFieldCount() == 0) { | 24824 | if (inst_child_ty.structFieldCount() == 0) { |
| | 24825 | // Optional slice is represented with a null pointer so |
| | 24826 | // we use a dummy pointer value with the required alignment. |
| 24825 | const slice_val = try Value.Tag.slice.create(sema.arena, .{ | 24827 | const slice_val = try Value.Tag.slice.create(sema.arena, .{ |
| 24826 | .ptr = Value.undef, | 24828 | .ptr = if (dest_info.@"align" != 0) |
| | 24829 | try Value.Tag.int_u64.create(sema.arena, dest_info.@"align") |
| | 24830 | else |
| | 24831 | try inst_child_ty.lazyAbiAlignment(target, sema.arena), |
| 24827 | .len = Value.zero, | 24832 | .len = Value.zero, |
| 24828 | }); | 24833 | }); |
| 24829 | return sema.addConstant(dest_ty, slice_val); | 24834 | return sema.addConstant(dest_ty, slice_val); |