diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-04 13:51:06 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-06-06 23:42:14 -0700 |
| commit | 178ee8aef1b9f765da916f3e1e4cab66437f8e0a (patch) | |
| tree | 0119946d420aee2c58be466cfa83fd237cabcfb0 /src/Sema.zig | |
| parent | e19886a898eeafd5f81eccaa4c7decba8cea70b4 (diff) | |
| download | zig-178ee8aef1b9f765da916f3e1e4cab66437f8e0a.tar.gz zig-178ee8aef1b9f765da916f3e1e4cab66437f8e0a.zip | |
Sema: fix invalid pure Air instruction with comptime-known operands
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 37aa3fb6e8..c732a283a0 100644 --- 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) |
