authorgravatar for 98954111+munmaks@users.noreply.github.comMun Maks <98954111+munmaks@users.noreply.github.com> 2025-04-08 11:35:12+02:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-04-09 12:53:11+01:00
log4fc783670a0871c43ccf17faf4f17d8a7e07e50c
treef8cafbd1785754a3e85439936003ae4a47cbae79
parent79a620d617aaadbdf39a2536f3ac85ef1f6fb53e

Sema/arith.zig: Fixing more typos from #23177.

This is a complementary PR to #23487 (I had only found one typo before). Now I've looked at the whole `arith.zig` file, trying to find other potential problems. Discussion about these changes: https://github.com/ziglang/zig/pull/23177#discussion_r1997957095

1 files changed, 2 insertions(+), 2 deletions(-)

src/Sema/arith.zig+2-2
...@@ -86,7 +86,7 @@ pub fn subMaybeWrap(...@@ -86,7 +86,7 @@ pub fn subMaybeWrap(
86) CompileError!Value {86) CompileError!Value {
87 const zcu = sema.pt.zcu;87 const zcu = sema.pt.zcu;
88 if (lhs.isUndef(zcu)) return lhs;88 if (lhs.isUndef(zcu)) return lhs;
89 if (lhs.isUndef(zcu)) return rhs;89 if (rhs.isUndef(zcu)) return rhs;
90 switch (ty.zigTypeTag(zcu)) {90 switch (ty.zigTypeTag(zcu)) {
91 .int, .comptime_int => return (try intSubWithOverflow(sema, lhs, rhs, ty)).wrapped_result,91 .int, .comptime_int => return (try intSubWithOverflow(sema, lhs, rhs, ty)).wrapped_result,
92 .float, .comptime_float => return floatSub(sema, lhs, rhs, ty),92 .float, .comptime_float => return floatSub(sema, lhs, rhs, ty),
...@@ -105,7 +105,7 @@ pub fn mulMaybeWrap(...@@ -105,7 +105,7 @@ pub fn mulMaybeWrap(
105) CompileError!Value {105) CompileError!Value {
106 const zcu = sema.pt.zcu;106 const zcu = sema.pt.zcu;
107 if (lhs.isUndef(zcu)) return lhs;107 if (lhs.isUndef(zcu)) return lhs;
108 if (lhs.isUndef(zcu)) return rhs;108 if (rhs.isUndef(zcu)) return rhs;
109 switch (ty.zigTypeTag(zcu)) {109 switch (ty.zigTypeTag(zcu)) {
110 .int, .comptime_int => return (try intMulWithOverflow(sema, lhs, rhs, ty)).wrapped_result,110 .int, .comptime_int => return (try intMulWithOverflow(sema, lhs, rhs, ty)).wrapped_result,
111 .float, .comptime_float => return floatMul(sema, lhs, rhs, ty),111 .float, .comptime_float => return floatMul(sema, lhs, rhs, ty),