commit 178ee8aef1b9f765da916f3e1e4cab66437f8e0a (tree)
parent e19886a898eeafd5f81eccaa4c7decba8cea70b4
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date: Wed, 4 Jun 2025 13:51:06 -0400
Sema: fix invalid pure Air instruction with comptime-known operands
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Sema.zig b/src/Sema.zig
@@ -32508,11 +32508,11 @@ fn analyzeSlice(
const actual_len = if (array_ty.zigTypeTag(zcu) == .array)
try pt.intRef(.usize, array_ty.arrayLenIncludingSentinel(zcu))
else if (slice_ty.isSlice(zcu)) l: {
- const slice_len_inst = try block.addTyOp(.slice_len, .usize, ptr_or_slice);
+ const slice_len = try sema.analyzeSliceLen(block, src, ptr_or_slice);
break :l if (slice_ty.sentinel(zcu) == null)
- slice_len_inst
+ slice_len
else
- try sema.analyzeArithmetic(block, .add, slice_len_inst, .one, src, end_src, end_src, true);
+ try sema.analyzeArithmetic(block, .add, slice_len, .one, src, end_src, end_src, true);
} else break :bounds_check;
const actual_end = if (slice_sentinel != null)