authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-06-04 13:51:06-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-06-06 23:42:14-07:00
log178ee8aef1b9f765da916f3e1e4cab66437f8e0a
tree0119946d420aee2c58be466cfa83fd237cabcfb0
parente19886a898eeafd5f81eccaa4c7decba8cea70b4

Sema: fix invalid pure Air instruction with comptime-known operands


1 files changed, 3 insertions(+), 3 deletions(-)

src/Sema.zig+3-3
...@@ -32508,11 +32508,11 @@ fn analyzeSlice(...@@ -32508,11 +32508,11 @@ fn analyzeSlice(
32508 const actual_len = if (array_ty.zigTypeTag(zcu) == .array)32508 const actual_len = if (array_ty.zigTypeTag(zcu) == .array)
32509 try pt.intRef(.usize, array_ty.arrayLenIncludingSentinel(zcu))32509 try pt.intRef(.usize, array_ty.arrayLenIncludingSentinel(zcu))
32510 else if (slice_ty.isSlice(zcu)) l: {32510 else if (slice_ty.isSlice(zcu)) l: {
32511 const slice_len_inst = try block.addTyOp(.slice_len, .usize, ptr_or_slice);32511 const slice_len = try sema.analyzeSliceLen(block, src, ptr_or_slice);
32512 break :l if (slice_ty.sentinel(zcu) == null)32512 break :l if (slice_ty.sentinel(zcu) == null)
32513 slice_len_inst32513 slice_len
32514 else32514 else
32515 try sema.analyzeArithmetic(block, .add, slice_len_inst, .one, src, end_src, end_src, true);32515 try sema.analyzeArithmetic(block, .add, slice_len, .one, src, end_src, end_src, true);
32516 } else break :bounds_check;32516 } else break :bounds_check;
3251732517
32518 const actual_end = if (slice_sentinel != null)32518 const actual_end = if (slice_sentinel != null)