diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-11-09 18:32:15 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-11-11 18:00:05 +0200 |
| commit | 40a2dfc12a611082ba6810c566a6a46acdb864fc (patch) | |
| tree | 566aaa3511c394dbd47fb15cd24bab720dbefea4 /src | |
| parent | 9b832e7f530833de93857444a86e34c8d99e4755 (diff) | |
| download | zig-40a2dfc12a611082ba6810c566a6a46acdb864fc.tar.gz zig-40a2dfc12a611082ba6810c566a6a46acdb864fc.zip | |
Sema: coerce array operands to shuffle
Closes #13494
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 b93a892dcc..51b1592c26 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -20179,8 +20179,8 @@ fn analyzeShuffle( .elem_type = elem_ty, }); - if (maybe_a_len == null) a = try sema.addConstUndef(a_ty); - if (maybe_b_len == null) b = try sema.addConstUndef(b_ty); + if (maybe_a_len == null) a = try sema.addConstUndef(a_ty) else a = try sema.coerce(block, a_ty, a, a_src); + if (maybe_b_len == null) b = try sema.addConstUndef(b_ty) else b = try sema.coerce(block, b_ty, b, b_src); const operand_info = [2]std.meta.Tuple(&.{ u64, LazySrcLoc, Type }){ .{ a_len, a_src, a_ty }, |
