diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-19 20:44:58 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-19 20:45:53 +0200 |
| commit | 6511afcfe090f26345873e7e8db3ae301f8a18a7 (patch) | |
| tree | 5b5284adcd5445737bef0b17021651dab6d95cb1 /src/Sema.zig | |
| parent | 0c1d8659c51d9544fb8d5de7481e750149c262ae (diff) | |
| download | zig-6511afcfe090f26345873e7e8db3ae301f8a18a7.tar.gz zig-6511afcfe090f26345873e7e8db3ae301f8a18a7.zip | |
Sema: fix coercion from `[:0]T` to `[*c]T`
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index f03211210c..f068018ddb 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -24615,8 +24615,9 @@ fn coerceExtra( else => break :p, } if (inst_info.size == .Slice) { - if (dest_info.sentinel == null or inst_info.sentinel == null or - !dest_info.sentinel.?.eql(inst_info.sentinel.?, dest_info.pointee_type, sema.mod)) + assert(dest_info.sentinel == null); + if (inst_info.sentinel == null or + !inst_info.sentinel.?.eql(Value.zero, dest_info.pointee_type, sema.mod)) break :p; const slice_ptr = try sema.analyzeSlicePtr(block, inst_src, inst, inst_ty); |
