diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-02-05 19:53:12 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-02-05 19:53:12 +0000 |
| commit | fbe0ae4fd4128a3652071b4b5985d68ae56e9992 (patch) | |
| tree | a122df94fa0b93d6c0b4c28bf5d5ae9d9385d282 /src | |
| parent | 0f38558435a0f73c4c025b5641bd8e531f063e0c (diff) | |
| download | zig-fbe0ae4fd4128a3652071b4b5985d68ae56e9992.tar.gz zig-fbe0ae4fd4128a3652071b4b5985d68ae56e9992.zip | |
Sema: fix PTR of slice of sentinel-terminated array
Resolves: #20901
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 7b8999a211..97e90da92e 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -34603,14 +34603,14 @@ fn resolvePeerTypesInner( } // Clear existing sentinel ptr_info.sentinel = .none; - switch (ip.indexToKey(ptr_info.child)) { + if (ptr_info.flags.size == .one) switch (ip.indexToKey(ptr_info.child)) { .array_type => |array_type| ptr_info.child = (try pt.arrayType(.{ .len = array_type.len, .child = array_type.child, .sentinel = .none, })).toIntern(), else => {}, - } + }; } opt_ptr_info = ptr_info; |
