| ... | @@ -885,7 +885,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE | ... | @@ -885,7 +885,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE |
| 885 | const lhs_is_slice_sentinel = lhs_tag == .slice_sentinel; | 885 | const lhs_is_slice_sentinel = lhs_tag == .slice_sentinel; |
| 886 | const lhs_is_open_slice = lhs_tag == .slice_open or | 886 | const lhs_is_open_slice = lhs_tag == .slice_open or |
| 887 | (lhs_is_slice_sentinel and tree.fullSlice(full.ast.sliced).?.ast.end == 0); | 887 | (lhs_is_slice_sentinel and tree.fullSlice(full.ast.sliced).?.ast.end == 0); |
| 888 | if (node_tags[node] != .slice_open and | 888 | if (full.ast.end != 0 and |
| 889 | lhs_is_open_slice and | 889 | lhs_is_open_slice and |
| 890 | nodeIsTriviallyZero(tree, full.ast.start)) | 890 | nodeIsTriviallyZero(tree, full.ast.start)) |
| 891 | { | 891 | { |
| ... | @@ -897,7 +897,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE | ... | @@ -897,7 +897,7 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE |
| 897 | } else try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, node_datas[full.ast.sliced].rhs); | 897 | } else try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, node_datas[full.ast.sliced].rhs); |
| 898 | | 898 | |
| 899 | const cursor = maybeAdvanceSourceCursorToMainToken(gz, node); | 899 | const cursor = maybeAdvanceSourceCursorToMainToken(gz, node); |
| 900 | const len = if (full.ast.end != 0) try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end) else .none; | 900 | const len = try expr(gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, full.ast.end); |
| 901 | const sentinel = if (full.ast.sentinel != 0) try expr(gz, scope, .{ .rl = .none }, full.ast.sentinel) else .none; | 901 | const sentinel = if (full.ast.sentinel != 0) try expr(gz, scope, .{ .rl = .none }, full.ast.sentinel) else .none; |
| 902 | try emitDbgStmt(gz, cursor); | 902 | try emitDbgStmt(gz, cursor); |
| 903 | const result = try gz.addPlNode(.slice_length, node, Zir.Inst.SliceLength{ | 903 | const result = try gz.addPlNode(.slice_length, node, Zir.Inst.SliceLength{ |