aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorJustus Klausecker <justus@klausecker.de>2025-08-09 02:33:25 +0200
committerJustus Klausecker <justus@klausecker.de>2025-08-12 16:33:58 +0200
commit277e4a8337b233a5d74f8f5b74d606210cf6fd97 (patch)
treeea76b3852a13b15dd809157383d4a468730d6250 /src/Sema.zig
parent4ec421372f1d8dba8a2221d2ea9c774cdbefbe9d (diff)
downloadzig-277e4a8337b233a5d74f8f5b74d606210cf6fd97.tar.gz
zig-277e4a8337b233a5d74f8f5b74d606210cf6fd97.zip
fix: emit vector instead of scalar u1_zero in shl_with_overflow logic
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index ac07552874..094154e46b 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -15620,7 +15620,6 @@ fn zirOverflowArithmetic(
// If either of the arguments is undefined, IB is possible and we return an error.
// If lhs is zero, the result is zero and no overflow occurred.
// If rhs is zero, the result is lhs and no overflow occurred.
- // Oterhwise if either of the arguments is undefined, both results are undefined.
const scalar_ty = lhs_ty.scalarType(zcu);
if (maybe_rhs_val) |rhs_val| {
if (maybe_lhs_val) |lhs_val| {
@@ -15661,7 +15660,7 @@ fn zirOverflowArithmetic(
.lt => return sema.failWithNegativeShiftAmount(block, rhs_src, rhs_elem, elem_idx),
}
}
- if (!any_positive) break :result .{ .overflow_bit = .zero_u1, .inst = lhs };
+ if (!any_positive) break :result .{ .overflow_bit = try pt.aggregateSplatValue(overflow_ty, .zero_u1), .inst = lhs };
},
else => unreachable,
}